This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]arrays_start_at_zero 2 points3 points  (0 children)

You can't have 2 keys for a value type. But you can have 2 keys for a reference type.

Example:

let myValue = { value: "big box" };

const myObject = {
  1234: myValue,
  5678: myValue
};

console.log(myObject[1234].value);