javascript Set map code example
Example 1: append to map javascript
var myMap = {};
myMap[newKey] = newValue;
var myMap = new Map()
myMap.set("key0","value")
myMap.has("key1");
Example 2: new map js
let utilisateurs = new Map()
utilisateurs.set('Mark Zuckerberg' ,{
email: '[email protected]',
poste: 'PDG',
})
utilisateurs.set ('bill Gates',{
email: '[email protected]' ,
poste : 'sauver le monde' ,
})
console.log(utilisateurs);
Example 3: map in javascript
['elem', 'another', 'name'].map((value, index, originalArray) => {
console.log(.....)
});