Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Last active October 12, 2021 03:41
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 McLarenCollege/20f5514302a360b3feee2fa4ef21a82f to your computer and use it in GitHub Desktop.
Save McLarenCollege/20f5514302a360b3feee2fa4ef21a82f to your computer and use it in GitHub Desktop.
Exercise Name : Function Trace Foo Bar
//FUNCTION TRACE 3
// Requirements: Create a trace output file showing each function call
// including parameter values, and each return value. You should be able
// to step through with pen and paper - do not run the code on your computer
// Tip: To refresh your memory of how to write trace output, see this gist:
// https://gist.github.com/McLarenCollege/e276ecc7dc3485a483be469f61dfd671
function foo(koo, y) {
if ((koo % 3) !== 0) {
return y === 'hellomax';
}
else {
return 'max';
}
}
function bar(x) {
let y = 'hello';
if (x + 10 >= 19) {
y = foo(6, x) + y;
}
else {
y = y + 'yooo';
}
return y;
}
console.log(!foo(5, bar(10)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment