Thursday , September 19 2024

Examine the following code: let a = (n) => { return n > 2 ? n * a(n – 1) : 2 } a(6); What will appear on the console as a result?

Questions BankCategory: JavaScript Essentials 1Examine the following code: let a = (n) => { return n > 2 ? n * a(n – 1) : 2 } a(6); What will appear on the console as a result?
Examine the following code:

let a = (n) => {
    return n > 2 ? n * a(n - 1) : 2
}
a(6);

What will appear on the console as a result?

  • 6
  • 720
  • 120
  • 4

More Questions: JavaScript Essentials 1 – JSE1: Final Test