Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

como fazer map em javascript

// Exemplo 1
const apresentacao = ['Ilan', 'Daniela'];
// ['Ilan', 'Daniela']
apresentacao.map(nome => `Olá, ${nome}. Bem-vind@ :)`);
// ["Olá, Ilan. Bem-vind@ :)", "Olá, Daniela. Bem-vind@ :)"]

// Exemplo 2
const apresentacao = [2, 4, 6, 8];
// [2, 4, 6, 8]
apresentacao.map(num => `${num}^2 = ${num**2}`)
(5) ["2^2 = 4", "4^2 = 16", "6^2 = 36", "8^2 = 64"]
Comment

PREVIOUS NEXT
Code Example
Javascript :: using the watch method to monitor route updates in vue 
Javascript :: most common use cases of portals in react 
Javascript :: adding growl delete notifications in vanilla js 
Javascript :: promises and not callbacks 
Javascript :: console log update status bar 
Javascript :: npm run coverage is throwing some error 
Javascript :: elemente alphabetisch sortieren javascript 
Javascript :: how to access match object in class component 
Javascript :: angular injector.create example 
Javascript :: javascript array from datalist 
Javascript :: javascript inicializar una variable 
Javascript :: Updating Object Properties 
Javascript :: concept of node js with react js 
Javascript :: mat slider in a reactve form 
Javascript :: reactive forms angular conditional disabling 
Javascript :: how to update value in nested json using id in javascript 
Javascript :: hark javascript 
Javascript :: stopper un intervalle javascript 
Javascript :: how many characters can fit in 1 line of div 
Javascript :: Ocultar o mostrar elementos html con js 
Javascript :: js repeat from string num 
Javascript :: Laravel bootstrap 5 install popper.js error 
Javascript :: {backgroundimage: `url("${require(`../../assets/images/${post.image}`)}")`}; 
Javascript :: react strap documentation 
Javascript :: momen js get time zone code from location name 
Javascript :: js update all links 
Javascript :: File to XHR-requests 
Javascript :: new date in interpolation angular 
Javascript :: 4.3.2. Evaluating Variables¶ 
Javascript :: filter object javascript es6 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =