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.

1 comment:

Unknown said...

myTectra Placement Portal is a Web based portal brings Potentials Employers and myTectra Candidates on a common platform for placement assistance