jashkenas/coffee-script — Issue #1794: Destructuring assignment issue
Author: wuyuntao
Created: 2011-10-23 01:01:40+00:00
State: open

CoffeeScript

```
obj = {}
array = [1,2,3]
[obj.first, obj.rest...] = array
```

JavaScript

```
var array, obj, obj.rest;
var __slice = Array.prototype.slice;
obj = {};
array = [1, 2, 3];
obj.first = array[0], obj.rest = 2 <= array.length ? __slice.call(array, 1) : [];
```
It declares `obj.rest` which causes a syntax error