Created
March 16, 2015 00:43
-
-
Save Spaxe/547655c7508ba7c0c24b to your computer and use it in GitHub Desktop.
It's 2015 and I still have to write this to iterate through objects in Javascript.
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
// Util functions | |
var Util = { | |
loop: function (obj, callback) { | |
for (var x in obj) { | |
if (obj.hasOwnProperty(x)) { | |
callback(x, obj[x]); | |
} | |
} | |
return obj; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment