• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2  "type": "Program",
3  "statements": [
4    {
5      "type": "VariableDeclaration",
6      "declarations": [
7        {
8          "type": "VariableDeclarator",
9          "id": {
10            "type": "ArrayPattern",
11            "elements": [
12              {
13                "type": "Identifier",
14                "name": "a",
15                "decorators": [],
16                "loc": {
17                  "start": {
18                    "line": 17,
19                    "column": 6
20                  },
21                  "end": {
22                    "line": 17,
23                    "column": 7
24                  }
25                }
26              },
27              {
28                "type": "RestElement",
29                "argument": {
30                  "type": "Identifier",
31                  "name": "b",
32                  "decorators": [],
33                  "loc": {
34                    "start": {
35                      "line": 17,
36                      "column": 12
37                    },
38                    "end": {
39                      "line": 17,
40                      "column": 13
41                    }
42                  }
43                },
44                "loc": {
45                  "start": {
46                    "line": 17,
47                    "column": 9
48                  },
49                  "end": {
50                    "line": 17,
51                    "column": 13
52                  }
53                }
54              }
55            ],
56            "loc": {
57              "start": {
58                "line": 17,
59                "column": 5
60              },
61              "end": {
62                "line": 17,
63                "column": 14
64              }
65            }
66          },
67          "init": {
68            "type": "ArrayExpression",
69            "elements": [
70              {
71                "type": "NumberLiteral",
72                "value": 1,
73                "loc": {
74                  "start": {
75                    "line": 17,
76                    "column": 18
77                  },
78                  "end": {
79                    "line": 17,
80                    "column": 19
81                  }
82                }
83              }
84            ],
85            "loc": {
86              "start": {
87                "line": 17,
88                "column": 17
89              },
90              "end": {
91                "line": 17,
92                "column": 20
93              }
94            }
95          },
96          "loc": {
97            "start": {
98              "line": 17,
99              "column": 5
100            },
101            "end": {
102              "line": 17,
103              "column": 20
104            }
105          }
106        }
107      ],
108      "kind": "var",
109      "loc": {
110        "start": {
111          "line": 17,
112          "column": 1
113        },
114        "end": {
115          "line": 17,
116          "column": 21
117        }
118      }
119    },
120    {
121      "type": "ExpressionStatement",
122      "expression": {
123        "type": "AssignmentExpression",
124        "operator": "=",
125        "left": {
126          "type": "Identifier",
127          "name": "b",
128          "decorators": [],
129          "loc": {
130            "start": {
131              "line": 18,
132              "column": 1
133            },
134            "end": {
135              "line": 18,
136              "column": 2
137            }
138          }
139        },
140        "right": {
141          "type": "ArrayExpression",
142          "elements": [
143            {
144              "type": "NumberLiteral",
145              "value": 1,
146              "loc": {
147                "start": {
148                  "line": 18,
149                  "column": 6
150                },
151                "end": {
152                  "line": 18,
153                  "column": 7
154                }
155              }
156            }
157          ],
158          "loc": {
159            "start": {
160              "line": 18,
161              "column": 5
162            },
163            "end": {
164              "line": 18,
165              "column": 8
166            }
167          }
168        },
169        "loc": {
170          "start": {
171            "line": 18,
172            "column": 1
173          },
174          "end": {
175            "line": 18,
176            "column": 8
177          }
178        }
179      },
180      "loc": {
181        "start": {
182          "line": 18,
183          "column": 1
184        },
185        "end": {
186          "line": 18,
187          "column": 9
188        }
189      }
190    }
191  ],
192  "loc": {
193    "start": {
194      "line": 1,
195      "column": 1
196    },
197    "end": {
198      "line": 18,
199      "column": 9
200    }
201  }
202}
203TypeError: Type '[1]' is not assignable to type '[]'. [arrayDestructuring9.ts:18:1]
204