Created
December 23, 2014 10:17
-
-
Save tarzak/451c741e8e91df2cf623 to your computer and use it in GitHub Desktop.
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 = [1,2,3,4,5,6,7,8]; | |
| var lookArr = function(array, callback) { | |
| var i = 0, | |
| len = array.length; | |
| if (typeof callback !== 'function') { | |
| callback = false; | |
| } | |
| for(; i < len; i += 1) { | |
| if(array[i] % 2 === 0) { | |
| console.log(array[i] + ' is even.'); | |
| if(callback) { | |
| callback(array[i]); | |
| } | |
| } | |
| } | |
| } | |
| var divideElement = function(element) { | |
| return element / 2; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment