Use the filter Method to Extract Data from an Array - Functional Programming - Free Code Camp

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

Your explanation makes way more sense than hints on FCC. Thank You so much!

howmuch
Автор

Thanks for making this step by step video. I wish all FCC lessons had an option to go through the solution step by step like this

neighbor
Автор

I find your videos much more helpful than the tutorial itself, I fail to comprehend by just reading. Your explanation is awesome, keep it up Ian!

mcilhennyest
Автор

I agonised over this for four hours., and actually came very close in what I needed to do/ Your explanation was excellent. Top notch. Definitely learned something from it.

JonathanWrightSA
Автор

If anyone watching this and need shorter line. Here it is:
.filter(individualMovie => > 8.0)

thinhnguyen
Автор

my solution
const filteredList = >= 8.0).map(el=>{
return {title: el["Title"], rating: el["imdbRating"]}
})

RayOfGlory
Автор

Thanks, I had the same problem I did the same but my problem was putting the filter directly with the array two times with map and filter thanks for helping me the explanation is pretty good.

alfredofernandezlapaix
Автор

Thank you very much. My code was...
// Only change code below this line

var extractedList = watchList.map(movie => {
let movieData = {};
movieData.title = movie.Title;
movieData.rating = movie.imdbRating;
return movieData;
})

var filteredList = extractedList.filter(movie => {
return parseFloat(movie.rating) >= 8;
})

// Only change code above this line

console.log(filteredList);

Initially, it was old-school JS but I watched your vid and refactored it a bit 🙂
Cheers again!

calin
Автор

You're the best! Thank you very much!

ArmandoPineda
Автор

I did nothing to convert the rating strings to numbers (at first i did and my specific method wasn't working? even tho the solution on the console log looked right) and it passed? confusing

helgirl
Автор

I did it like this:
const mapedList = watchList.map(x => ({
title: x.Title,
rating: x.imdbRating
}))

const filteredList = mapedList.filter(x => x.rating >= 8.0)

following the example they use in the explanation

gabob
Автор

how did you make your intellisense work on your browser?

alvirfrancisco
Автор

Hey, why did you declare an empty object? let refinedMovieData = {}; not sure if I'm understanding your logic here.

MrNate
Автор

Did freecodecamp get rid of those tooltips that keep popping up? I don't see anything about it in the settings.

nickpacanowski
Автор

let filteredList = watchList.filter(movie => movie.imdbRating > 8).map(movie => ({title: movie.Title, rating: movie.imdbRating} ));


console.log(filteredList);

lend