Friday, September 28, 2018

JavaScript Map Function

How does JavaScript Map Function work....

Here is an example

var numbers = [4, 9, 16, 25];

function myFunction() {
    x = document.getElementById("demo")
    x.innerHTML =;

If I execute the above function as part of my Javascript it print


So what happened using map function I applied the Math.sqrt to every element of my numbers array.