JavaScript Fundamentals: Filtering an Array

preview_player
Показать описание
If you need to filter values in an array, you should be using the filter method, not a loop. In this tutorial we do a deep dive into the filter method.

For more resources on JavaScript:

Full personalized courses on JavaScript:

Courses offered on Udemy: Getting Started or Advanced Topics at a huge discount:

Tutorials referred to in this video:
Рекомендации по теме
Комментарии
Автор

Thank you for this tutorial! This was extremely helpful. You're the best!

ChrisTian-oxnr
Автор

Filtering works well with checking dates too, so awesome! Not sure if I've the correct syntax doing this though... although it works.

const date = [new Date()];
date.push(new Date('2020-10-10'));
date.push(new Date('2005-6-10'));
date.push(new Date('2010-11-6'));
date.push(new Date('1999-01-01'));



let passDates = date.filter( val => (val > new Date('2000-01-01')));

console.table([passDates]);

karlstenator