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.
@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.
