Answers for "javascript object map"

13

map through keys javascript

var myObject = { 'a': 1, 'b': 2, 'c': 3 };

Object.keys(myObject).map(function(key, index) {
  myObject[key] *= 2;
});

console.log(myObject);
// => { 'a': 2, 'b': 4, 'c': 6 }
Posted by: Guest on July-30-2020
5

javascript iterate object key values

Object.entries(obj).forEach(([key, value]) => {
	console.log(key, value);
});
Posted by: Guest on March-30-2020
4

for key value in object javascript

for (const [key, value] of Object.entries(object1)) {
  console.log(`${key}: ${value}`);
}
Posted by: Guest on December-09-2020
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);
Posted by: Guest on March-17-2020
2

object to map javascript

const map = new Map(Object.entries({foo: 'bar'}));

map.get('foo'); // 'bar'
Posted by: Guest on March-02-2021
1

javascript map to object

Object.fromEntries(Map)
Posted by: Guest on March-17-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language