I have an array of object called actors:
const actors = [{
"name": "John Doe",
"rating": 1234,
"alternative_name": null,
"objectID": "551486300"
},
{
"name": "Jane Doe",
"rating": 4321,
"alternative_name": "Monica Anna Maria Bellucci",
"objectID": "551486310"
}];
I specifically want to get the name and the ratings of the actors. I tried getting it by making a function called actorNameRating, but my code does not work.
const nameAndRating = function() {
const actorName = nameAndRating.filter(name);
return actorName;
const actorRating = nameAndRating.filter(rating);
return actorRating;
};