Created
February 6, 2018 17:00
-
-
Save telingadigital/d6997ef676a5c58905c31e8411a0aee9 to your computer and use it in GitHub Desktop.
Remove Odd number from array Javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function removeOdd(arr){ | |
for(var i = arr.length-1; i--;){ | |
if (arr[i]%2 !== 0) | |
arr.splice(i, 1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment