A

Admin • 828.03K Points
Coach

Q. What will be the output of the following JavaScript code?

Code:
<script>
const values = [10, 20, 30];
const result = values.map(myFunction);

document.write("Result: ", result);

function myFunction(value, index, array) {
return value * value;
}
</script>
  • (A) Result: 10,20,30
  • (B) Result: 10*10,20*20,30*30
  • (C) Result: 100,400,900
  • (D) ValueError
  • Correct Answer - Option(C)
  • Views: 6
  • Filed under category JavaScript
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.