首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >How do I console.log only the highestRated rating和highestRated rating的电影标题

How do I console.log only the highestRated rating和highestRated rating的电影标题
EN

Stack Overflow用户
提问于 2021-10-16 02:11:21
回答 1查看 33关注 0票数 0

我一直试图只找出电影的评级和标题,但当控制台日志highestRated时,我不断得到完整的对象。How do I console.log only the highestRated rating和highestRated rating的电影标题

样本输出;

最高评分:小丑(10分)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-10-16 02:24:41

获取highestRated rating和highestRated movieTitle

代码语言:javascript
复制
// movieTitle
console.log(highestRated.movieTitle);
// rating
console.log(highestRated.rating);

// Output highest rated: Joker(10)
console.log(`highest rated : ${highestRated.movieTitle} (${highestRated.rating})`);
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69592173

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档