Iterate through keys in an object literal and return the key name.


/ Published in: JavaScript
Save to your folder(s)

Returns the key name in mainObject if it's a key, and hasOwnProperty of key (to rule out the prototype object. Then it also checks if the key is listed in an array using a jquery function and also tests if it's null.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.