JavaScript tips | How to compare arrays #shorts

preview_player
Показать описание
Pls do subscribe and support channel for more videos!
#ExploreJS

Music:

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

Why the sort?
@Fabri . In this example, fruits1 & fruits3 had same elements but were in different indexes, so sorting is needed before comparison. If the indexes of the array elements does not change, then sort is not necessary.

explorejs
Автор

Won't work. Test with nulls and undefined and you'll see why.

exploreMauritius