map = new Map<number, string>();
this.map.set(1, "educadmin");
this.map.set(6, "hr");
this.map.set(7, "tech");
console.log(map);
//process 1
for (let entry of this.map.entries()) {
console.log(entry[0], entry[1]);
}
//process 2
Array.from(map.values(), (value: string) => {
console.log(value);
});
I get this when I logged to the console:
Map(0) {}
size: (...)
__proto__: Map
[[Entries]]: Array(3)
0:{6 => "hr"}
1: {1 => "educadmin"}
2: {7 => "tech"}
length: 3
I want to add get all these values -> hr , educadmin and tech to a string[] I tried above 2 process but I am not able to read