0

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
  • 572,313
  • 128
  • 898
  • 1,281
cosmicluna
  • 439
  • 1
  • 3
  • 13

1 Answers1

0

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

sp00m
  • 46,243
  • 25
  • 134
  • 239