Created
October 24, 2022 12:51
-
-
Save esciafardini/7074d917c44c5230e09dd8d2aac64268 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 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