Creating Maps from arrays and objects | Data Structure | JavaScript

preview_player
Показать описание
In this lecture, we are going to learn more about Maps in JavaScript. You will learn following things in this lecture:

1. How to add entries to a map at once?
2. How to convert an object into a map?
3. How to extract arrays from a map?
4. How to iterate over a map?

Рекомендации по теме
Комментарии
Автор

Awesome 👌 👏 👍 man . Really good explanation 👏

malikrajat
Автор

const kvArray = [
{ key: 1, value: 10 },
{ key: 2, value: 20 },
{ key: 3, value: 30 },
];

const reformattedArray = kvArray.map(({ key, value}) => ({ [key]: value }));


can some one help me with this?
when we need value from the Key we are using brackets[] but when we need the value from the value why are we not using brackets.

what i know is when we need to get value we always use []..

please help.

FM