javascript - 在 Google apps 脚本中获取 json 数组中的键->值

标签 javascript json google-apps-script

在 Google Apps 脚本中,我获取了一个 JSON 对象数组。如果我想访问“id: value”的键值对,我可以简单地执行以下操作吗?

 var id = myArrayofJson[0].id;

我会使用 jQuery,但 Google Api 不允许这样做。

最佳答案

我拥有的是一个 json 对象数组,所以我的问题的答案是:

for(i=0; i < myArray.length; i++){
  var receive = myArray[i][jsonId][anotherId];
 }

我只是不知道如何正确使用 json 数组,但得到了你和其他人的帮助。谢谢。

关于javascript - 在 Google apps 脚本中获取 json 数组中的键->值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12645263/

相关文章:

javascript - 如果选中复选框一,则取消选中复选框二、三、四和五

javascript - 如何阻止背景样式覆盖 React 内联样式的 backgroundColor 样式?

json - 什么是Erlang最成熟的JSON库?

javascript - 使用 find Text() 多次出现时的额外匹配

鼠标按下时的 JavaScript

javascript - 将php数组动态传递给javascript

javascript - JSON 与 '-' 在 Angular js 的关键阅读

javascript - Web服务错误捕获(Jquery + asp.net Web服务)

arrays - 如何使用 Google Apps 脚本通过 for 循环将值添加到二维数组

javascript - 在 Google Apps 脚本中显示 HTML 格式的消息框?