Map() question For Loop Problem

Map() question For Loop Problem
0

#1

I am now currently working on Functional Programming. Even though I haven’t used the for loop but still tells me that I have used for loop. Here is my code

let rating = watchList.map(function(x){
  return {'title': x.Title, 'rating': x.imdbRating};
 });

And here is the question
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/functional-programming/use-the-map-method-to-extract-data-from-an-array

Can anyone tell me what is wrong here ?
Thank You.


#2

It’s working for me when I copy/paste your solution and REPLACE the original version. Did you just comment out the original for loop, perhaps? When I did that, the test failed.


#3

Yes, I did that @vipatron.


#4

So it passes now that you’ve deleted the commented code?


#5

And after Deleting the for loop I get the result. Thanks a lot @vipatron.


#6

Go ahead and mark my original comment as the solution then. Have a good day!