Object format is causing issues

Tell us what’s happening:
It looks like it’s not passing test because the format of the object is not the format of the solution object, But I can not find out why this only returns the “title” as an unquoted key. The stringified object of the default code, in console.log is correct, but on test run, the object keys and values are not the correct string format? What am I missing?

Your code so far


var ratings = watchList.map(item => { 
  
    let title = item.Title
    let rating = item.Rated
  
    let newobj = {
      "title" : title,
      "rating" : rating,
    }
    
  return newobj
});
console.log(ratings)

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36.

Challenge: Use the map Method to Extract Data from an Array

Link to the challenge:

hey @nelliesnoodles,

you should be accessing imdbRating but you are accessing Rated instead.

1 Like

Ohhhhh… I’ll try that

That was it… I knew I was missing something. I never looked at the solution rating value, just assumed there was only one rating in the obj. Thank you!!

1 Like