x
is an object
let x = {a: [0], b: [1], c: [2], d: [3]}
y
is a an array
let y = [4, 5, 6, 7]
What is the proper way to push y
into x
such that x
becomes
x = {a: [0, 4], b: [1, 5], c: [2, 6], d: [3, 7]}
I've done it using for
loop but maybe there is a better way.