
"executions": [ "date-started": { "unixtime": 1571209884000, "date": "2019-10-16T07:11:24Z" } ] 类似这样子的,怎么在 JS 中处理呢?当这个对象被转化为 JS 对象后,是怎么存在的?
1 jadehare 2019-11-06 17:05:03 +08:00 Unexpected token |
2 Vegetable 2019-11-06 17:06:55 +08:00 大哥你这格式不对,[key:value]了 const c = {"a-b":1} console.log(c["a-b"]) 是这么存的。 |
3 Vegetable 2019-11-06 17:07:54 +08:00 |
4 JiShuTui 2019-11-06 17:09:11 +08:00 "executions": [ 这里应该是大括号吧 "executions": { |
5 Greendays OP 好吧,我脑子一下没转过来,这样就可以了 ```js var jobExecution = execution.executions[0] var datetime = jobExecution["date-ended"].unixtime ``` |
6 wmhx 2019-11-06 19:17:03 +08:00 你的[]是数组, 里面要么是简单类型要么就是对象{}, 你这样看起来像是缺了{}, 不是正确的 JSON 格式, 无法读取的. |
7 itechify PRO 正常.和[]都可以,特殊的用后者 |