Skip to content

Instantly share code, notes, and snippets.

@McLarenCollege
Last active August 26, 2021 07:20
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/83c7b9a26b7855c793573edc82e7cab0 to your computer and use it in GitHub Desktop.
Save McLarenCollege/83c7b9a26b7855c793573edc82e7cab0 to your computer and use it in GitHub Desktop.
Function Trace Average

Function Trace Average

Write a function trace for the following code:

function average(num1, num2, num3) {
  let sum = num1 + num2 + num3;
  return (sum / 3);
}
let x = average(1 + average(4, 10, 2) % 3, 2, average(-2, -2, 10) );
console.log(x);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment