Last active
June 1, 2016 09:23
-
-
Save friedemannsommer/df773f7d1e458b2f6f4012419d094247 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
function forEach(list, callback) { | |
var keys = Object.keys(list); | |
var index = -1; | |
var length = keys.length >>> 0; | |
while (++index < length) { | |
callback(list[keys[index]], keys[index], list); | |
} | |
} |
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 forEach(list:Object, callback:(value:any, key:string, object:Object) => void):void { | |
let keys:Array<string> = Object.keys(list); | |
let index:number = -1; | |
let length:number = keys.length >>> 0; | |
while(++index < length){ | |
callback(list[keys[index]], keys[index], list); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment