Skip to content

Instantly share code, notes, and snippets.

@afontcu
Last active August 26, 2019 16:56
Show Gist options
  • Save afontcu/b3e74ea4079a7868e5e9b5ba85e6ef33 to your computer and use it in GitHub Desktop.
Save afontcu/b3e74ea4079a7868e5e9b5ba85e6ef33 to your computer and use it in GitHub Desktop.
function assert (actual) {
return {
equals (expected) {
if (actual !== expected) {
throw new Error(`${actual} is not equal to ${expected}`)
}
console.log(`${actual} equals ${expected}`)
}
}
}
// assert(add('0,1,2,3')).equals(6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment