Home / Programming MCQs / JavaScript MCQs / Question

R

Ram Sharma • 188.81K 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

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.