Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/476.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 访问以数字形式写入strg名称的对象_Javascript_Json_Object_Google Apps Script_Google Sheets - Fatal编程技术网

Javascript 访问以数字形式写入strg名称的对象

Javascript 访问以数字形式写入strg名称的对象,javascript,json,object,google-apps-script,google-sheets,Javascript,Json,Object,Google Apps Script,Google Sheets,正在使用google电子表格脚本编辑器 //这个脚本很好用 function myFunc2() { var json = SpreadsheetApp.getActiveSheet().getRange('R4').getValue(); var data = JSON.parse(json); for (key in data) { if (key == "vehicles"){ for (key in data

正在使用google电子表格脚本编辑器

//这个脚本很好用

function myFunc2() {

  var json = SpreadsheetApp.getActiveSheet().getRange('R4').getValue();

  var data = JSON.parse(json);

  for (key in data) {                   

    if (key == "vehicles"){

      for (key in data.vehicles) { 

        if (key == "inrealiamanumber"){                                                 

          for (key in data.vehicles.inrealiamanumber) {        

               Logger.log(data.vehicles.inrealiamanumber.name);
          }
        }
      }
    }
  }
}
但是->在realiamanumber中,您需要使用

工作;-)我总是和这个符号打交道,当它变得深刻时,特别是在javascript中。哇,答案来得多快啊,哈哈。(时间和日期的意思很快;-)新年快乐,你让我开心,新年快乐?;-)@Summingwong,很乐意帮忙:)&新年快乐
 data.vehicles["38803218"]