Javascript Function Chaining

Run Settings
LanguageJavaScript
Language Version
Run Command
var myObj = { hasPerms: false, check : function( doChain ){ this.hasPerms = doChain; console.log( 'Checkinnngggg...' ); return this; }, then : function( callback ){ if( this.hasPerms ){ callback(); } else { return false; } } }; //"chain, chain, chain..." myObj.check( false ).then( function(){ console.log( 'I GOT FOO\'D'); });
Editor Settings
Theme
Key bindings
Full width
Lines