Created
February 17, 2010 01:11
-
-
Save rkatic/306155 to your computer and use it in GitHub Desktop.
eachProperty
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($){ | |
var hasOwnProperty = Object.prototype.hasOwnProperty | |
$.eachProperty = function( obj, func, context ) { | |
for ( var i in obj ) { | |
// Own properties are enumerated firstly, so no need to continue on first not own. | |
if ( !hasOwnProperty.call(obj, i) || func.call( context, i, obj[i] ) === false ) { | |
break; | |
} | |
} | |
return obj; | |
} | |
})(jQuery || this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment