✅ – dmikester1 – 19-47 Mar 14
I have 2 objects with the same keys. I want to combine the objects into a single array of objects.
D
dmikester1•407d ago
The combined array would look like this:
V
Vanishy•407d ago
are these two objects just separate variables? In that case you literally just do
const array = [obj1, obj2]
D
dmikester1•407d ago
They are separate variables, I'll see what that does.
unfortunately, that just creates an array with the 2 objects
V
Vanishy•407d ago
oh sorry, I misunderstood the question
you want to iterate through the keys of the first object with
Object.keys(obj1).map(key => { ... })
and inside the map you can have the logic to get questions and answersD
dmikester1•407d ago
ok, that makes sense
UU
Unknown User•407d ago
230KMembers
View on DiscordMore Posts
✅ – Ygg – 22-32 Mar 8Hello, I'm using a `FreeCompanyContext` to use some variables across my website
One of then is usingVuNguyen – 12-56 Mar 8How do I create a virtual microphone, then pipe audio to it using NodeJS?VuNguyen – 05-04 Mar 8Hey, I'm currently looking for a way to create an output device with NodeJS, then other programs can