“Karte in JavaScript” Code-Antworten

Verwenden Sie die Kartenmethode in JavaScript

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

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

Karte in JavaScript

//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

Karte in JavaScript

const arr = [1, 2, 3, 4, 5, 6];
const mapped = arr.map(el => el + 20);	//[21, 22, 23, 24, 25, 26]
kinjal suryavanshi

Karte in JavaScript

['elem', 'another', 'name'].map((value, index, originalArray) => { 
  console.log(.....)
});
Ntiyiso-Rikhotso

Karte in JavaScript

let myMap = new Map()

let keyString = 'a string'
let keyObj    = {}
// setting the values
myMap.set(keyString, "value associated with 'a string'")
myMap.set(keyObj, 'value associated with keyObj')
myMap.set(keyFunc, 'value associated with keyFunc')
myMap.size              // 3
// getting the values
myMap.get(keyString)    // "value associated with 'a string'"
myMap.get(keyObj)       // "value associated with keyObj"
myMap.get(keyFunc)      // "value associated with keyFunc"
Vishal

Karte in JavaScript

swarna
raju
mano
swa
hys
kil
des
rohit
swaru
Frightened Frog

Ähnliche Antworten wie “Karte in JavaScript”

Fragen ähnlich wie “Karte in JavaScript”

Weitere verwandte Antworten zu “Karte in JavaScript” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen