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>
β
Correct Answer: (C)
Result: 100,400,900