map in js
// map => map are used for the keys and values pair where keys can be used any
// any type of data type and its also store same value of multiple time
// in map we are used these type of function
// new Map()- for create the map
// set - for the set the keys and values
//get - getiing the keys and values
//keys-- getting the keys
//values-- getting the values
// delete - delete the entire map
// clean --
// has -- checking these values have or not
//entrie
// forEach
// properties
// size
const person = new Map();
person.set(1,'rohit');
person.set(2,'kk');
person.set(3,'kumar');
person.set(4,'rohit');
person.set(1,'rohitk');
person.set(2,'kk');
console.log(person.get(4))
console.log('this the keys')
for(let x of person.keys()){
console.log(x)
}
console.log('this is values')
for(let x of person.values()){
console.log(x)
}
console.log('entrie function')
for (let x of person.entries()){
console.log(x)
}
let t = "";
let x = person.forEach(function(value){
t=t+' '+ value;
console.log(t)
})
console.log(person.delete());
console.log(person.get(1))