Edit: simplifying further.
Take a look at this code snippet:
let arr = [42,69]
arr.key = 'lol'
This code adds a key value to an array.
Is there a way to combine these two lines into one? I've been trying different syntax but nothing seems to work.
I want to do this because I plan to push this array into another array. Although I could use an object instead, I need to be able to pop items from it later on, which doesn't work with objects.
let all = []
all.push({'0':42,'1':69,'key':'lol'})