Code Wars Javascript Tutorial Array Diff

preview_player
Показать описание
Code Wars problem on Array Diff. The direction weren't super clear but we got through it.
Рекомендации по теме
Комментарии
Автор

Thank you for this. I had no idea what this question was asking and felt discouraged.

mlh
Автор

not sure why anyone would dislike this.. Me personally doing c# i find it interesting you doing it through js.
I did complete most of these excercise your doing but still. I can learn from someone else workings :)
good job

gutsberserker
Автор

I dont understand why he ran the same loop again with the arrays reversed, it works perfectly with just the first loop?

bannerthelord
Автор

You should have tried "return a.filter((element) => !b.includes(element));

eklavyasharma
Автор

"let unique = [];
for (let i =0;i < a.length; i++) {

if (b.indexOf(a[i]) === -1) {
unique.push(a[i]);
}
}
return unique; "
this code works, without
addition checks.

girishpoojari
visit shbcf.ru