Node.js discord.js如何从json文件中获取desc值
当我运行Node.js discord.js如何从json文件中获取desc值,node.js,json,discord.js,Node.js,Json,Discord.js,当我运行console.log(data[key].use)命令时,我在数据中加载了json文件,我得到了一个响应 [ { name: 'Devour', desc: 'Consumes a target tree to gain 7 health regeneration for 16 seconds. Consuming a ward or Ironwood Tree doubles the heal amount.\n\nComes with 3 charges. C
console.log(data[key].use)命令时,我在数据中加载了json文件,我得到了一个响应
[ { name: 'Devour',
desc:
'Consumes a target tree to gain 7 health regeneration for 16 seconds. Consuming a ward or Ironwood Tree doubles the heal amount.\n\nComes with 3 charges.
Can be used on an allied hero to give them one Tango.\n\nTree Range: %abilitycastrange%\nWard Range: 450' } ]
如何获取desc
值
我尝试了数据[key]。使用.desc
但给了我未定义的您可以尝试数据[key]。使用[0]。desc
?我想你得到的结果是在某些地方出现了一个新问题,它的主动
部分被动
甚至切换
而不是使用
我能做什么?如果我这样做| |它给了我[0]无法读取0的属性
更别说得到它了