Created
July 7, 2016 04:46
-
-
Save raphaklaus/c2ed229685380358e1cc9f5fb795b1c2 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 numeroPar(numero) { | |
return new Promise(function(resolve, reject) { | |
setTimeout(function() { | |
if (numero % 2 === 0) | |
resolve(); | |
else | |
reject(new Error('Não é um número par'); | |
}, 2000); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment