Last active
December 6, 2019 14:55
-
-
Save kcoyner/3a257398c383ed938e934489090491dd 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 getMoneyBack(money, callback) { | |
money = String(money) // force the error | |
if (typeof money !== 'number') { | |
callback(null, new Error('money is not a number')) | |
// callback(new Error('money is not a number')) | |
} else { | |
callback(money) | |
} | |
} | |
getMoneyBack(1200, function(money) { | |
console.log(money) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment