πŸ“Š JavaScript
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
πŸ’¬ Discuss
βœ… Correct Answer: (C) Result: 100,400,900

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
197
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
95%
Success Rate