JS equivalent of RGSSx Hash.keys

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
In Ace, I have something that goes like this:


@objects = {}
@objects[1] = ...
@objects[2] = ...
@objects[3] = ...

return @objects.keys


which would give me [1, 2, 3]


In JS, I've tried to duplicate this as:


this._objects = {};

this._objects[1] = ...;
this._objects[2] = ...;
this._objects[3] = ...;


What is the equivalent command that will result in an array with the values [1, 2, 3]?


Note, the hash/object keys aren't necessarily going to be numbers, or sequential.  I've just used those for simplicity.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
Thank you - that's just what I want.  I'll give it a go.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,466
Members
137,821
Latest member
Capterson
Top