Javascript Coffeescript数组销毁忽略某些值

Javascript Coffeescript数组销毁忽略某些值,javascript,arrays,coffeescript,Javascript,Arrays,Coffeescript,我在coffeescript中使用了数组销毁,它工作正常: [first, second, third] = [1, 2, 3] console.log "First:" + first, "Second:" + second, "Third:" + third 但我希望能够忽略数组元素。我想这样做: [, second, third] = [1, 2, 3] console.log "Second:" + second, "Third:" + third 这在EcmaScript 6中是可

我在coffeescript中使用了数组销毁,它工作正常:

[first, second, third] = [1, 2, 3]
console.log "First:" + first, "Second:" + second, "Third:" + third
但我希望能够忽略数组元素。我想这样做:

[, second, third] = [1, 2, 3]
console.log "Second:" + second, "Third:" + third

这在EcmaScript 6中是可能的,但是如何在Coffescript下实现这一点呢

我只是想知道怎么做。这可以通过扩展运算符完成:

[..., second, third] = [1, 2, 3]
console.log "Second:" + second, "Third:" + third

轶事,但当我用回调函数替换正则表达式而不关心“整场匹配”参数时,我会编写
string.replace(/regex/,function(u,capture1,capture2…{…})
。使用
\u
作为“一次性”变量名。也许你也可以用
[\uuu,第二,第三]
做同样的事情?不知道这是否有帮助:谢谢你的评论。这是一个想法,但我更喜欢“真正的”忽略