Created
February 6, 2014 12:15
-
-
Save bondarewicz/8843037 to your computer and use it in GitHub Desktop.
JS: Array even numbers filter
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
var arr = [4,5,7,8,14,45,76]; | |
function even(a){ | |
return a.filter(function(val){return val%2===0}) | |
} | |
alert(even(arr)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReferenceError: alert is not defined