Skip to content

Instantly share code, notes, and snippets.

@esciafardini
Created October 24, 2022 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esciafardini/7074d917c44c5230e09dd8d2aac64268 to your computer and use it in GitHub Desktop.
Save esciafardini/7074d917c44c5230e09dd8d2aac64268 to your computer and use it in GitHub Desktop.
function assert(condition, message) {
if (condition) console.log(message)
else console.log('Assertion failed')
}
var text = 'Ricky!'
function useless(ninjaCallback) {
console.log('Inside USELESS function')
return ninjaCallback()
}
function getText() {
console.log('Inside getText function')
return text
}
console.log('functions are now defined...')
console.log('Before making the calls....')
assert(useless(getText) === text, 'The function worked: ' + text)
assert(function() {return text} == text, "passed")
console.log('All calls have been made')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment