We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d548f6a commit 86040e0Copy full SHA for 86040e0
tests/cases/compiler/destructuringAssignmentWithDefault.ts
@@ -8,9 +8,25 @@ let x = 0;
8
function f1(options?: { color?: string, width?: number }) {
9
let { color, width } = options || {};
10
({ color, width } = options || {});
11
+ let x1 = (options || {}).color;
12
+ let x2 = (options || {})["color"];
13
}
14
15
function f2(options?: [string?, number?]) {
16
let [str, num] = options || [];
17
[str, num] = options || [];
18
+ let x1 = (options || {})[0];
19
+}
20
+
21
+function f3(options?: { color: string, width: number }) {
22
+ let { color, width } = options || {};
23
+ ({ color, width } = options || {});
24
25
26
27
28
+function f4(options?: [string, number]) {
29
+ let [str, num] = options || [];
30
+ [str, num] = options || [];
31
32
0 commit comments