Created
January 24, 2015 21:48
-
-
Save vastus/123b7ceae74daa3a5d40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function lupaa(cond) { | |
return new Promise(function (resolve, reject) { | |
if (cond) { | |
resolve('Tuli'); | |
} | |
reject('Meni'); | |
}); | |
} | |
lupaa(true).then(function success(result) { | |
console.log('success', result); | |
}, function fail(err) { | |
console.error(err); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment