从JavaScript中收集变量中的所有值

时间:2017-03-16 11:26:00

标签: javascript angularjs

var collectionsd在控制台日志中返回,如

[5.2140564, 52.3705452]
[5.2180339, 52.3363171]
[5.2424313, 52.3595914]
[5.2739435, 52.388464]
[5.2368864, 52.336711]

在前端节目中只有[5.2368864, 52.336711]我需要在JavaScript中使用。

var collectionsd = [[5.2140564, 52.3705452],[5.2180339, 52.3363171],[5.2424313, 52.3595914],[5.2739435, 52.388464],[5.2368864, 52.336711]];

更新:-1

this.variables = JSON.parse(jso);
    this.passing=[];
    zc.passing.push(zc.variables['geo']);
    console.log(zc.passing);
ouptut:-
[5.2140564, 52.3705452]
[5.2180339, 52.3363171]
[5.2424313, 52.3595914]
[5.2739435, 52.388464]
[5.2368864, 52.336711]

我需要制作zc。在单个数组中传递值。

1 个答案:

答案 0 :(得分:0)

是的,这是可能的。你可以这样做。

selection