What will be the output of the following JavaScript code? [code] <p id="demo"></p> <script> var numbers1 = [4, 9]; var numbers2 = numbers1.map(m

What will be the output of the following JavaScript code?
Code:
<p id="demo"></p>
<script>
var numbers1 = [4, 9];
var numbers2 = numbers1.map(myFunction);
document.getElementById("demo").innerHTML = numbers2;
function myFunction(value, index, array) 
{
  return value * 2;
}
</script>
A. 8 9
B. 8 18
C. 4 9
D. Error
 

Tìm kiếm

Back
Top