Thank you sir. Great video. I had assumed making the object an object array the array high functions would work correctly on them. But the key was to literally to call Object.keys on the object to access it keys then properties. Thank you again.
What about each using JSON stringify to check if the string equivalents of the objects are equal? I tried it, and it seems to work. The syntax is also much easier. Is there a disadvantage to using this or some gotcha that I am not considering? Are there any plans to add a method in JS to make deep clones of objects or to check for object equality?
Thank you sir. Great video. I had assumed making the object an object array the array high functions would work correctly on them. But the key was to literally to call Object.keys on the object to access it keys then properties. Thank you again.
Glad it helped!
Great tutorial, thanks. Im curious what the code would look like when the values are indeed objects or arrays.
Do you mean what I showed at the start when I cycled through the array normally or I you referring to something else?
Your English sounds so clear & also thanks for your solutions...:)(:
You're welcome 😊
I love your tutorials. Keep up the good work
You can check if the content of each key is an object or an array or a simple value. Then use recursion approach
I like the idea!
what about JSON.stringify(obj1) === JSON.stringify(obj2) ?
Love it!! Great suggestion!
@@AllThingsJavaScript this is a deep compare vs shallow one in the video. correct?
@@ortania Yes, this would work as a deep compare.
Hope one day you will make just a simple app with JS (like a todo list) .
What about each using JSON stringify to check if the string equivalents of the objects are equal? I tried it, and it seems to work. The syntax is also much easier. Is there a disadvantage to using this or some gotcha that I am not considering? Are there any plans to add a method in JS to make deep clones of objects or to check for object equality?
Yes, great idea with JSON.stringify. The only gotcha I can think of is with sub objects. Some issue that comes up with deep cloning.
What about checking the other direction hasSameDataObh(obj2, obj1). ? Maybe obj2 has more properties than obj1
he did check the length of the objects to be the same, so it can't have more properties
@@GodsDevil5thF Thanks forgot it
Stringify is the best solution
Thanks for the video, I have a question? what if the objects have nested object then we need to loop through it?
Yes, that becomes much more complicated. YOu would need to loop through those. Perhaps that would be a good follow up tutorial.
How to compare array of json objects irrespective of its order
Can you provide an example of what you are trying to do?
@@AllThingsJavaScript just re-order the elements in obj2...
I have array inside the object . And I have to check the same data . Please upload video on it . Thanks in advance. Please reply
Can you provide a sample of your objects?
Please modify this function. It will really works for me