I have an object which I am trying to get an array of the values of, however whenever I run Object.values(), it returns an empty array. I also get an empty array when I run Object.keys() or Object.entries(). Also when I try and loop through the properties of the array (Like so:
for(var property in object){}), it runs 0 times, like there are no keys/values in the object.
The object itself is definitely not empty at the time of running Object.values, as to debug this issue, I had the result of Object.values logged to the console(which was an empty array), and on the line before that, I had the object logged to the console, and the object was not empty. The properties of the object are also accessible by using objectName.propertyName, or objectName["propertyName"]. The object's keys are strings and its values are arrays. The objects properties were defined by Object.defineProperty().
I am using the React framework.
According to tests I ran in a js console, this should not be happening.
Does anyone know why this is happening and how to fix it?
Please let me know if you would like me to provide any information or code.
enumerable, by default it isfalse