How to Sort an Array based on Another Array in JavaScript

preview_player
Показать описание
Hey guys and gurls! It's 2020. With the first pick in the 2020 video draft. RhymBil selects How to Sort an Array based on Another Array. This is going to be a banger video. I personally used this when making a search engine. I had to sort the search item with its percent match. Crazy. Hope you find it useful. It saved my coding career. Lol Happy New Year again.

Until next time
RhymBil out
Рекомендации по теме
Комментарии
Автор

Instead of using Chrome, you can also use Brave Browser. It's actually better than Chrome and it's also based on Chromium.

MaxProgramming
Автор

Interesting, thanks!

You could use .find() instead of .filter():

speed.forEach((speed_value) => {
const found_car = cars_n_speed .find((car) => car[1] === speed_value);
if (found_car)
})

scottwager
welcome to shbcf.ru