Filter JavaScript Arrays Like a Boss

preview_player
Показать описание
#shorts
Рекомендации по теме
Комментарии
Автор

This video didn't tell us how to filter an array like a boss.

redorange
Автор

you also can write like this, which is little bit simple :const unique = [...new Set(arr)]

stevenwinsir
Автор

What's going on behind the scenes? What's the time complexity of that? Seems like it would be slow.

HelloWorld-fgnm
Автор

sets aren’t talked about enough. more practical problems solved by sets would be greatly appreciated!

aarond
Автор

let uniqueColors = [...new Set(colors)]

bowiemtl
Автор

Not only JS, most modern languages have set()

blender_wiki
Автор

Boss doesn't filter array, that's ur job

danhnhan
Автор

Okay, but what if I have an array of objects? 😂😂😂

Тима-ууш
Автор

Can you achieve this with array of objects?

panshak
Автор

I use set method to duplicate array of data types string. It’s cool though

Snapchk
Автор

That's what I need, just in PHP.

punkerts
Автор

ok, so how do you filter an array? :)))

stefanddamian
Автор

Cool, but now do it in O(1) memory :D

silentlyow
Автор

Useful, but still lot oc code when comparing to Python 😅

Btw, does Set in JS preserves order of items?

Forseti
Автор

learnt about this yesterday in my JS course!!!!

so useful 😃

okaforraphael
Автор

Pls answer, when scrolling with keyboard with ctrl + up/down in windows and the cursor is in another place so when I leave ctrl button, and move cursor with keyboard up/down button in order to place the cursor in currently scrolled place, the scroll goes to the first place where the cursor was! so what is the benefit of keyboard scrolling? is there any way when scrolling with keyboard move cursor along????

sabbirsobhani
visit shbcf.ru