Sha256: 2d82532c88a746863f1d140f74f35f88bc6a32d1cca3bf308a7bc071362bb579
Contents?: true
Size: 884 Bytes
Versions: 24
Compression:
Stored size: 884 Bytes
Contents
//>>excludeStart("exclude", pragmas.exclude); define([ "shoestring" ], function(){ //>>excludeEnd("exclude"); /** * Iterates over `shoestring` collections. * * @param {function} callback The callback to be invoked on each element and index * @return shoestring * @this shoestring */ shoestring.fn.each = function( callback ){ return shoestring.each( this, callback ); }; shoestring.each = function( collection, callback ) { var val; //>>includeStart("development", pragmas.development); if( !( "length" in collection ) ) { shoestring.error( 'each-length' ); } //>>includeEnd("development"); for( var i = 0, il = collection.length; i < il; i++ ){ val = callback.call( collection[i], i, collection[i] ); if( val === false ){ break; } } return collection; }; //>>excludeStart("exclude", pragmas.exclude); }); //>>excludeEnd("exclude");
Version data entries
24 entries across 24 versions & 1 rubygems