Skip to content

Instantly share code, notes, and snippets.

@kevinweber
Last active April 14, 2016 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinweber/d95a504da6a0a51dd2104a2076cefcef to your computer and use it in GitHub Desktop.
Save kevinweber/d95a504da6a0a51dd2104a2076cefcef to your computer and use it in GitHub Desktop.
/**
* Loop through an object and call a passed function
*/
function loopObject(object, func) {
var property;
for (property in object) {
if (object.hasOwnProperty(property)) {
func(property, object);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment