Javascript - Map Data Type

1 - About

3 - Type

3.1 - Object

Object as associative array.


let a = { "a":1, "b":1 };
a["b"]=2;
console.log(a);

3.2 - Map

A map object has also been create to implement a more sophisticated map type.

Example:


keyValues= new Map();
keyValues.set("name","nico");
keyValues.set("color","blue");
for (const keyValue of keyValues){
    const [key, value] = keyValue 
    console.log("Key: "+key+", value: "+value);
}

values return an iterator


keyValues= new Map();
keyValues.set("name","nico");
keyValues.set("color","blue");

it = keyValues.values();
let result = it.next();
while (!result.done) {
 console.log(result.value); 
 result = it.next();
}

4 - Documentation / Reference


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap