使标识符或关键字跟随数字标识符反应-快速API
我尝试使用 Rapid api 中的 coinranking api,但当 ai 显示加密货币的 24 小时交易量时出现错误。
数据显示如下:
Object
data:
coin:
24hVolume: "21504479215"
allTimeHigh: {price: '68763.41083248306', timestamp: 1636502400}
但是当我输入 cryptoDetails?.coin.24hVolume 时,
我收到一条错误消息:标识符或关键字不遵循数字标识符。
我怎样才能覆盖这个?
I try to use the coinranking api from rapid api but i get a error when a i went to display the 24h volume of a cryptocurrency.
the data is display like this:
Object
data:
coin:
24hVolume: "21504479215"
allTimeHigh: {price: '68763.41083248306', timestamp: 1636502400}
but when i type cryptoDetails?.coin.24hVolume
I got a error that say: An identifier or keyword does not follow a numeric identifier.
How i can override this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JavaScript 中不允许使用数字标识符。但是,您可以使用 Bracket 访问对象属性符号。
像这样。
Numeric identifiers are not allowed in JavaScript. However, you could access to object properties using Bracket Notation.
Like this.