JavaScript Problem: Checking if Two Arrays are Equal Part 2

preview_player
Показать описание

Would you like to help keep this channel going?

Tutorials referred to in this video:

For more resources on JavaScript:

#javascript #AllThingsJavaScriptLLC
Рекомендации по теме
Комментарии
Автор

Always Awesome. Please make long videos like this

arunkaiser
Автор

checkUniqueItems does it on its own, just compare the length at start of the function and it's done... or return it within checkArraysByRepeatedItems if you want but not with the every check part... Moreover, the last loop could be done with the every method when comparing the values of each object. Same with third solution arr1.every((val) => getCount(arr1, val) === getCount(arr2, val)) is sufficient and more accurate than reduce. Thanks to contributors.

jipeejoce