swc/crates/swc_ecma_parser/tests/tsc/arrayLiteral.ts

15 lines
274 B
TypeScript

// valid uses of array literals
var x = [];
var x = new Array(1);
var y = [1];
var y = [1, 2];
var y = new Array<number>();
var x2: number[] = [];
var x2: number[] = new Array(1);
var y2: number[] = [1];
var y2: number[] = [1, 2];
var y2: number[] = new Array<number>();