JavaScript Maps - All you need to Know / JavaScript Complete Map tutorial
Code:
// the map obj holds key-value pairs
//Creating a Map
let myMapTest = new Map()
//Map Size
console.log(myMapTest.size)
//Set Values for map
myMapTest.set(1,"Test1")
myMapTest.set(2,"Test2")
myMapTest.set(3,"Test3")
//Printing the Map
console.log(myMapTest)
//creating an Object
let obj = {
"size":1
}
//Getting the map values based on GET
console.log(myMapTest.get(1))
//key value pairs of Map
for (let [key,value] of myMapTest){
console.log(`${key} : ${value}`)
}
//Using entries
for (let [key,value] of myMapTest.entries()){
console.log(`${key} : ${value}`)
}
//Using has method
console.log(myMapTest.has(0))
//Using ForEach Map method
myMapTest.forEach((value)= console.log(`${value}`)) // arrow function
//Deleting a key in Map
myMapTest.delete(1)
console.log(myMapTest)
//Loop for deleting Keys
for (let key of myMapTest.keys()){
myMapTest.delete(key)
}
Description:
Maps in javascript
JavaScript Map and Set Explained
JavaScript Array Map
JavaScript Higher Order Functions & Arrays
JavaScript Maps | JavaScript Tutorial In Hindi
Map in Javascript
map Array Method | JavaScript Tutorial
Chapters:
0:00 - Introduction
0:56 - Map creation and its size
1:45 - Map set method
3:10 - Creating a simple object to show its difference with Maps
4:44 - Map get method and key value pairs
6:29 - Map clear method
7:12 - Map delete method
8:55 - Map entries method
10:18 - Map has method
11:01 - Map for each method
12:54 - End Tags and subscription to channel
Next Steps :
---------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------
Must Watch Playlists
► 1. Javascript - https://youtube.com/playlist?list=PLO2l2fYgN805CokP5kaOWOhqP3-2vyXdS
► 2. Puppetter - https://youtube.com/playlist?list=PLO2l2fYgN805E5fbSnvtFM3K9c92ePS8e
► 3. Cypress - https://youtube.com/playlist?list=PLO2l2fYgN807KRpLfvvrqa1MSX8XdYxkV
► 4. Tech works - https://www.youtube.com/watch?v=ZNAdt4Oe5Sw&list=PLO2l2fYgN807CQ5H3ER__7x7LeEA10T2Z
► 5. Vbscript Basics To Advanced - https://www.youtube.com/watch?v=z_ctZDolyG0&list=PLO2l2fYgN805CuD-90ESrxRqX__-YJMym
► 6. Jmeter - https://youtube.com/playlist?list=PLO2l2fYgN806eNr5cr-TMTX8xGTW7Mtcn
► 7. Excel - https://youtube.com/playlist?list=PLO2l2fYgN806piZ2fD0bYNi3ExoPJlcqj
► 8. Appium - https://www.youtube.com/playlist?list=PLO2l2fYgN806V_9-wL-dpmrGg8dhPPONK
► 9. Shares - https://youtube.com/playlist?list=PLO2l2fYgN806ySmKp3sskJW0ByJalmPE2
► 10. Javascript Interview Questions -https://youtube.com/playlist?list=PLO2l2fYgN807uZl7Mp7ESavluzVU25ux9
► 11. C# Tutorials - https://www.youtube.com/playlist?list=PLO2l2fYgN805Dct9KbYNYC8nGOzwKjklt
---------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------
#maps
#javascript
#javascriptHIgherOrderFunctions