Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在从 API 检索数据,它返回的对象中的字段之一是 @timestamp。当我尝试像item.@timestampjavascript 一样解析这些数据时,会抛出一个错误,因为 @ 符号被保留为装饰器。如何从使用保留字符的字段中检索数据?
item.@timestamp
使用item['@timestamp']而不是item.@timestamp.
item['@timestamp']
尝试改用括号表示法:
希望这会有所帮助!