53 lines
1.1 KiB
Text
53 lines
1.1 KiB
Text
=== tests/cases/compiler/arrayConstructors1.ts ===
|
|
var x: string[];
|
|
>x : string[]
|
|
|
|
x = new Array(1);
|
|
>x = new Array(1) : any[]
|
|
>x : string[]
|
|
>new Array(1) : any[]
|
|
>Array : ArrayConstructor
|
|
>1 : number
|
|
|
|
x = new Array('hi', 'bye');
|
|
>x = new Array('hi', 'bye') : string[]
|
|
>x : string[]
|
|
>new Array('hi', 'bye') : string[]
|
|
>Array : ArrayConstructor
|
|
>'hi' : string
|
|
>'bye' : string
|
|
|
|
x = new Array<string>('hi', 'bye');
|
|
>x = new Array<string>('hi', 'bye') : string[]
|
|
>x : string[]
|
|
>new Array<string>('hi', 'bye') : string[]
|
|
>Array : ArrayConstructor
|
|
>'hi' : string
|
|
>'bye' : string
|
|
|
|
var y: number[];
|
|
>y : number[]
|
|
|
|
y = new Array(1);
|
|
>y = new Array(1) : any[]
|
|
>y : number[]
|
|
>new Array(1) : any[]
|
|
>Array : ArrayConstructor
|
|
>1 : number
|
|
|
|
y = new Array(1,2);
|
|
>y = new Array(1,2) : number[]
|
|
>y : number[]
|
|
>new Array(1,2) : number[]
|
|
>Array : ArrayConstructor
|
|
>1 : number
|
|
>2 : number
|
|
|
|
y = new Array<number>(1, 2);
|
|
>y = new Array<number>(1, 2) : number[]
|
|
>y : number[]
|
|
>new Array<number>(1, 2) : number[]
|
|
>Array : ArrayConstructor
|
|
>1 : number
|
|
>2 : number
|
|
|