filter even numbers javascript
var arr1 = [-200, -163, -26, -4, 0, 7, 76];
var evens = arr1.filter(function(x) {
return x % 2 === 0;
})
console.log(evens);var arr = [-200, -163, -26, -4, 0, 7, 76];
var evens = arr.filter(x => x % 2 === 0);
// Array(5) [ -200, -26, -4, 0, 76 ]
Also in JavaScript:
- how react with socket
- javascript format social security number
- js modulo not working
- js pixelated
- how to destructure complex objects
- get image center pixels nodejs
- node pg array in
- in javascript check is is an array or not
- javascript ternary operator
- chartjs how to disable animation
- how to print a certain position in javascript
- React Children map example
- ignore all node_modules
- pegar qual domínio eu estou javascript
- angular input force uppercase
- installeer alle nodes in node red
- FAILURE: Build failed with an exception react native android
- how to write a variable in js
- intval js
- how to append object in array javascript
- toast in react native
- Iterate with JavaScript Do...While Loops
- js alert yes no
- js clone deep