“Mapa w JS” Kod odpowiedzi

MkTime in JS

var seconds = new Date(year, month, day, hours, minutes, seconds, 0).getTime() / 1000;
Comfortable Capuchin

Zainicjuj mapę JS

let map = new Map()
map['bla'] = 'blaa'
map['bla2'] = 'blaaa2'

console.log(map)  // Map { bla: 'blaa', bla2: 'blaaa2' }
PSK1103

Jak używać metody map w JavaScript

const numbers = [1, 2, 3, 4, 5]; 

const bigNumbers = numbers.map(number => {
  return number * 10;
});
TechWhizKid

tablica mapa MDN

let new_array = arr.map(function callback( currentValue[, index[, array]]) {
    // return element for new_array
}[, thisArg])
Bad Bison

Mapa w JS

//map() methods returns a new array
const data = {name: "laptop", brands: ["dell", "acer", "asus"]}
let inside_data = data.brands.map((i) => {
	console.log(i); //dell acer asus
});
D@RK$T@R

JS Map ()

var number = [1, 2 , 3, 4, 5, 6, 7, 8, 9]; 
var doubles  = number.map((n) => { return n*2 })

/*  doubles 
    (9) [2, 4, 6, 8, 10, 12, 14, 16, 18] */
ofroog

Odpowiedzi podobne do “Mapa w JS”

Pytania podobne do “Mapa w JS”

Więcej pokrewnych odpowiedzi na “Mapa w JS” w JavaScript

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu