Hi guys! I hope you can help me with this challenge,
I solved the challenge partially I converted 2d array in two objects current Inventory and New Inventory,
then I compared current inventory with new inventory and updated it if the property is in current inventory otherwise I add a property and its value.
Then I converted Object to a 2d array and It does the job, the issue is that I am not sure how to sort a 2d array alphabetically. I am wondering can I even sort object properties alphabetically or I need to sort it as array?
My output right now is:
[[88, "Bowling Ball"], [2, "Dirty Sock"], [3, "Hair Pin"], [5, "Microphone"], [3, "Half-Eaten Apple"], [7, "Toothpaste"]];
Expected output or correct output should be:
[[88, "Bowling Ball"], [2, "Dirty Sock"], [3, "Hair Pin"], [3, "Half-Eaten Apple"], [5, "Microphone"], [7, "Toothpaste"]]
Thanks for help everyone, I appreciate your time and effort,
Happy coding!