我如何 console.log 只有 highestRated 评级和 highestRated 评级的 Movie-title

How do I console.log only the highestRated rating and the Movie-title of highestRated rating

我一直试图只输出电影的评级和标题,但是当控制台记录 highestRated 我一直在获取完整的 object。 我如何 console.log 只有 highestRated 评级和 highestRated 评级

的 Movie-title

示例输出;

评分最高:小丑 (10)

获得 highestRated 评级和 highestRated 电影标题

// movieTitle
console.log(highestRated.movieTitle);
// rating
console.log(highestRated.rating);

// Output highest rated: Joker(10)
console.log(`highest rated : ${highestRated.movieTitle} (${highestRated.rating})`);