Skip to main content

Javascript Array map methods

 The map() method is used to get a modified version of the array or a reduced value using callback functions. map() applies a function to each array element and creates a new array of the returned values


Example :1 

const listArray = [1,2,3,4,5]

const listArray = listArray.map(Item => {

    return item * 2;

})


console.log(listArray);

Output : [2,4,6,8,10]

Comments

Popular posts from this blog

దోసకాయ పూర్ణం | cucumber curry

How to merge Objects in Javascript

 let person = {     firstName: 'Rocky',     lastName: 'g',     age: 23 }; let job = {     jobTitle: 'Angular Developer',     location: 'UK' }; let employee = {     ...person,     ...job }; console.log(employee);

క్యారెట్ ఊరగాయ | carrot pickle