Skip to content

Instantly share code, notes, and snippets.

@MarshallOfSound
Last active April 25, 2017 06:50
Show Gist options
  • Save MarshallOfSound/d6280d11ab1fdcf82c51 to your computer and use it in GitHub Desktop.
Save MarshallOfSound/d6280d11ab1fdcf82c51 to your computer and use it in GitHub Desktop.
Javascript implemenation of Life Motto :)
var count = 0,
sad = function() {
if (++count === 1) {
return true;
}
return {
stop: function() {
console.log("I AM HAPPY!!!!");
}
};
},
beAwesome = function() {
console.log("I AM NOW AWESOME!");
};
// Life motto
if (sad() === true) {
sad().stop();
beAwesome();
}
@klaun76
Copy link

klaun76 commented Apr 25, 2017

Positive way of thinking. Everybody could be sad only until asked once !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment