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 = numbers.map(Math.sqrt);
}

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

2,3,4,5

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

8 comments:

Unknown said...

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

Divya M said...

I am really happy with your blog because your article is very unique and powerful for new reader.
Click here:
selenium training in chennai
selenium training in bangalore
selenium training in Pune
selenium training in pune
Selenium Online Training

sudha P said...

I think you have a long story to share and i am glad after long time finally you cam and shared your experience.

Java training in Bangalore | Java training in Marathahalli | Java training in Bangalore | Java training in Btm layout

Java training in Bangalore | Java training in Marathahalli | Java training in Bangalore | Java training in Btm layout

Nila shri said...

Just stumbled across your blog and was instantly amazed with all the useful information that is on it. Great post, just what i was looking for and i am looking forward to reading your other posts soon!
Data Science Training in Chennai | Data Science Training institute in Chennai | Data Science course in anna nagar

Data Science course in chennai | Data Science Training institute in Chennai | Best Data Science Training in Chennai | Data science course in Bangalore | Data Science Training institute in Bangalore | Best Data Science Training in Bangalore

Data Science course in marathahalli | Data Science training in Bangalore | Data Science course in btm layout | Data Science training in Bangalore


gkr ragini said...

Really very nice blog information for this one and more technical skills are improve,i like that kind of post.
Devops Training courses
Devops Training in Bangalore
Best Devops Training in pune
Devops interview questions and answers

Mouni yoga said...

You got an extremely helpful website I actually have been here reading for regarding an hour. I’m an initiate and your success is incredibly a lot of a concept on behalf of me.
python course in pune
python course in chennai
python course in Bangalore

yamuna said...

Your very own commitment to getting the message throughout came to be rather powerful and have consistently enabled employees just like me to arrive at their desired goals.
angularjs interview questions and answers

angularjs Training in bangalore

angularjs Training in bangalore

angularjs Training in chennai

automation anywhere online Training

Rajesh said...

Very Nice Blog