Skip to content

Instantly share code, notes, and snippets.

@raphaklaus
Created July 7, 2016 04:46
Show Gist options
  • Save raphaklaus/c2ed229685380358e1cc9f5fb795b1c2 to your computer and use it in GitHub Desktop.
Save raphaklaus/c2ed229685380358e1cc9f5fb795b1c2 to your computer and use it in GitHub Desktop.
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