Create a gist now

Instantly share code, notes, and snippets.

Embed
MyEventManager.prototype.bootstrap = function ( ) {
var self = this;
this.listen( 'myEvent', function ( ) {
self.myEventListener( );
} );
};
// ---
var array = [ 1, 2, 3 ];
for ( var t = 0, l = array.length; t < l; ++ t )
doOp( array[ t ] );
// ---
var array = [ 1, 2, 3 ];
for ( var sum = 0, t = 0, l = array.length; t < l; ++ t )
sum += array[ t ];
MyEventManager.prototype.bootstrap = function ( ) {
this.listen( 'myEvent', this.myEventListener.bind( this ) );
};
// ---
var array = [ 1, 2, 3 ];
array.forEach( function ( n ) {
doOp( n ); } );
// ---
var array = [ 1, 2, 3 ];
var sum = array.reduce( function ( sum, n ) {
return sum + n; }, 0 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment