Skip to content

Tag: object

JavaScript: Comparing Two objects in one array

I’m new to this world of vanilla javascript. I’ve been trying complete some challenges but it seems like I’m unable to find the solution to a challenge. The task is:”Sort array by object property” Write a function that takes an array of objects as an argument Sort the array by pr…

Merge 2 arrays of object based on specific object key

I have 2 arrays which is contains same id with different value (inside selected) My goal is to merge both become 1 array. When I use spread operator like this: It comes the data being override First array Second array How can I make both of arrays become 1 ? the expected result: What am I doing wrong in the