1

I have a Map<string, mixed> in JS and do the following:

console.log('Data: ', dataMap);
console.log('Object: ', Object.getOwnPropertyNames(dataMap));

and the first line prints out what I expect:

0: {"data_field1" => 4}
1: {"data_field2" => "test"}
...etc

but when I use Object.getOwnPropertyNames, Object.keys or Object.entries there is nothing returned - it is just an empty array. Why would this be happening if the data is clearly there? Is there an alternative I can use to get access to all the properties/keys of that Map?

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
cosmicluna
  • 539
  • 1
  • 5
  • 16

1 Answers1

0

You said you're using a Map, so you're probably looking for #keys() or the like.

sp00m
  • 47,968
  • 31
  • 142
  • 252