Shallow Comparison Javascript vs Deep Comparison Javascript

Shallow Comparison Javascript vs Deep Comparison Javascript

Monsterlessons Academy

2 года назад

6,582 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@afifu
@afifu - 07.09.2023 01:40

Excellent explanation! 🔥

Ответить
@tolulopemalomo8922
@tolulopemalomo8922 - 27.05.2023 11:40

Any difference between the standard JavaScript typeof and your helper function typeOf?

Ответить
@anupsamanta5966
@anupsamanta5966 - 22.05.2023 20:07

Is it typeOf or typeof?

Ответить
@amansaxena3563
@amansaxena3563 - 17.01.2023 21:45

Gold content thanks for great video

Ответить
@jainlokesh318
@jainlokesh318 - 06.01.2023 15:03

Pretty good tutorial. But I guess one more case we can check where the second object i.e the target have some extra keys than the source.
source:- {a:"name", b: "myName"}
target:- {a:"name", b: "myName", c: "anotherName"}
Currently shallowCompare(source, target) will give true which isn't correct. You might agree to it

We can fix that by adding a condition to check the keys length
if (typeOf(source) === "object")
{
if (Object.keys(source).length !== Object.keys(target).length) {
return false;
}
return Object.keys(source).every((key) => source[key] === target[key]);
}

Ответить
@shvideo1
@shvideo1 - 05.10.2022 19:15

Great video. Very informative. Thank you for sharing it.

Ответить
@user-wm2oo3vw9r
@user-wm2oo3vw9r - 10.09.2022 03:26

Mesej yang jelas, struktur yang jelas, mudah difahami, terima kasih

Ответить
@mihaipascu4975
@mihaipascu4975 - 23.08.2022 11:23

Endlich ein komplettes Tutorial, sehr nuetzlich und schoen erklaert! Danke!!!

Ответить
@frederickobeng-nyarko2868
@frederickobeng-nyarko2868 - 21.08.2022 03:42

I love how you take your time to explain things.. clear and precise diction.. !

Ответить
@hierotsu
@hierotsu - 02.06.2022 01:43

Thanks for the great work!

Ответить
@daryaleylian8942
@daryaleylian8942 - 18.03.2022 01:25

Great video and excellent explanation, thank you for sharing!

Ответить
@rajuljadia1312
@rajuljadia1312 - 27.01.2022 20:33

What if the sequence of key pair value inside object is different?For eg :- How we can compare this
{name : 'xyz', age :3} and {age:3, name:'xyz'}
will the function deepclone you made will work for this.?

Ответить
@mariamitsotsolashvili7980
@mariamitsotsolashvili7980 - 02.01.2022 22:41

I find this video very interesting. Thank you !

Ответить
@vanlongpham8874
@vanlongpham8874 - 01.01.2022 19:44

it would be great if there is a playlist of similar videos at this level of concept. I really enjoyed this one. Thank you.

Ответить
@waldBestMusics
@waldBestMusics - 17.12.2021 14:46

Great teaching, please keep on teaching more !

Ответить
@IkraamDev
@IkraamDev - 09.12.2021 13:52

Nice videos as always. By the way you're pronouncing "target" incorrectly. You're saying "tarjet" instead of "target".

Ответить
@RajanYadav-ye7xv
@RajanYadav-ye7xv - 08.12.2021 15:40

I found your channel two days ago and I'm in love with your teaching style. You are awesome, please don't stop teaching.
I'm really having hard time with authentication in node js(sessons, jwt, oauth, custom authentication), Any chance to learn it from you?

Ответить
@zakaria2504
@zakaria2504 - 08.12.2021 15:36

great tutorial as usual

Ответить
@SvetaSveta-ms4hi
@SvetaSveta-ms4hi - 07.12.2021 22:17

Amazing tutorial! Thanks a bunch! 🙏

Ответить
@LeoL77
@LeoL77 - 07.12.2021 18:02

Great work, learnt something today :)

Ответить
@a_lodygin
@a_lodygin - 07.12.2021 17:43

Suggestion for the next video: deep cloning; I don't like using Lodash, but the need for cloning is very common for a large number of projects 😬

Ответить