I have this piece of code that pushes a new array inside another array:
pickedRocks.push([lastBin.rocks.pop()])
Before I push it I want to pass some keys too, to avoid keeping track of indexes, because I’m going be pushing more arrays. Is my only option to add the key after creation?
I tried:
pickedRocks.push([lastBin.rocks.pop(),key:500])
but it doesn’t work. And I’d like to not wrap it in another object to avoid rewriting other code.