Skip to content

Instantly share code, notes, and snippets.

@friedemannsommer
Last active June 1, 2016 09:26
Show Gist options
  • Save friedemannsommer/cd8e33c46146cd0672d7edda023fc3ed to your computer and use it in GitHub Desktop.
Save friedemannsommer/cd8e33c46146cd0672d7edda023fc3ed to your computer and use it in GitHub Desktop.
function forEach(list, callback) {
var index = -1;
var length = list.length >>> 0;
while (++index < length) {
callback(list[index], index, list);
}
}
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