Skip to content

Instantly share code, notes, and snippets.

@mattiaerre
Created March 21, 2016 23:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattiaerre/005ddfd87af6d159ea96 to your computer and use it in GitHub Desktop.
Save mattiaerre/005ddfd87af6d159ea96 to your computer and use it in GitHub Desktop.
(function() {
var you = true;
const MATTIA = 'Mattia';
var myName = {
is: function(name) {
return name == MATTIA
}
};
var to = {
call: {
me: function(name) {
if (myName != name) {
throw new Error('#epicfail');
}
}
}
};
if (you) {
try {
while (myName.is(MATTIA)) {
to.call.me('Matteo');
}
} catch (error) {
console.log('error:', error.message);
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment