24 lines
631 B
Text
24 lines
631 B
Text
=== tests/cases/compiler/isArray.ts ===
|
|
var maybeArray: number | number[];
|
|
>maybeArray : number | number[]
|
|
|
|
|
|
if (Array.isArray(maybeArray)) {
|
|
>Array.isArray(maybeArray) : boolean
|
|
>Array.isArray : (arg: any) => boolean
|
|
>Array : ArrayConstructor
|
|
>isArray : (arg: any) => boolean
|
|
>maybeArray : number | number[]
|
|
|
|
maybeArray.length; // OK
|
|
>maybeArray.length : number
|
|
>maybeArray : number[]
|
|
>length : number
|
|
}
|
|
else {
|
|
maybeArray.toFixed(); // OK
|
|
>maybeArray.toFixed() : string
|
|
>maybeArray.toFixed : (fractionDigits?: number) => string
|
|
>maybeArray : number
|
|
>toFixed : (fractionDigits?: number) => string
|
|
}
|