如果您在chrome控制台中运行它:
console.log.apply(null, [array])
Run Code Online (Sandbox Code Playgroud)
Chrome会给您一个错误:
// TypeError: Illegal Invocation
Run Code Online (Sandbox Code Playgroud)
为什么?(通过OSX在Chrome 15上测试过)
这是一个简单的问题,我以前做过.我只是不记得它是怎么称呼的.
在python我可以这样做:
arr = ['one', 'two']
one, two = arr
Run Code Online (Sandbox Code Playgroud)
我怎么用JavaScript做到这一点?
我有一个数组数组:
[
[1,2],
[2,3],
[4,3]
]
Run Code Online (Sandbox Code Playgroud)
我想将它们作为一系列变量传递给下划线函数.
_.intersection([1,2],[2,3],[4,3])
Run Code Online (Sandbox Code Playgroud)
如何才能做到这一点?