You can use Array filter method.
The code would look like this:
ar = [1, 2, 3, 4];
ar = ar.filter(item => !(item > 3));
console.log(ar) // [1, 2, 3]
More Related Contents:
- I want to make first option in dropdown to display as a placeholder
- jquery get id of input selected text
- JavaScript for…in vs for
- Angularjs Uncaught Error: [$injector:modulerr] when migrating to V1.3
- Why Does Firebase Lose Reference outside the once() Function?
- Pass data or modify extension html in a new tab/window
- How do I POST with multipart form data using fetch?
- What is the best way to limit concurrency when using ES6’s Promise.all()?
- ES6 classes : what about instrospection?
- How to make div fixed after you scroll to that div?
- getting how many people are in a chat room in socket.io [duplicate]
- How do I use external script that I add to react JS?
- Difference between “.innerHTML” and “.value” in JS
- Where is d3.svg.diagonal()?
- Custom exception type
- Angular 2 Material 2 datepicker date format
- Getting the value from a TinyMCE textarea
- Create a hidden field in JavaScript
- Put a Delay in Javascript
- Replace function not replacing [duplicate]
- In AngularJS, any inline javascript code that included in HTML templates doesn’t work
- Include Arabic characters in JavaScript regular expression?
- How to set custom validation messages for HTML forms?
- Why is element not being shown before alert?
- Pass a variable from content script to popup
- Use RegExp to match a parenthetical number then increment it
- sweet-alert display HTML code in text
- Testing code that uses an IntersectionObserver
- Clear a selection in Firefox
- How do I get Greasemonkey to click on a button that only appears after a delay?