Last active
June 1, 2016 09:26
-
-
Save friedemannsommer/cd8e33c46146cd0672d7edda023fc3ed to your computer and use it in GitHub Desktop.
This file contains 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 forEach(list, callback) { | |
var index = -1; | |
var length = list.length >>> 0; | |
while (++index < length) { | |
callback(list[index], index, list); | |
} | |
} |
This file contains 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 forEach(list:Array<any>, callback:(value:any,index:number,array:Array<any>) => void):void { | |
let index:number = -1; | |
let length:number = list.length >>> 0; | |
while(++index < length){ | |
callback(list[index], index, list); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment