JavaScript ES6 - Maps

preview_player
Показать описание
This video walks through ES6 Map's. How they are similar and different to Objects and how to use them!
Рекомендации по теме
Комментарии
Автор

Map still has a prototype. If you console log the global "this" variable, after creating a new Map you can still see it.

GalaticCoder
Автор

When and why would one want to use a function as a key?

EndorfinDelfin
Автор

I think we can use function as a property inside of an object, but correct me if i am wrong

Example:

let id = 0;
let obj = {
id,
getId() {
return this.id;
}
}

console.log(obj.getId());

amitpanda_CreatorStudio
Автор

doesn't it have a prototype? how did u call .size then? i'm questioning how javascript works rn 0_o

code