29 lines
588 B
Text
29 lines
588 B
Text
|
=== tests/cases/compiler/genericFunctions2.ts ===
|
||
|
declare function map <T, U > (items: T[], f: (x: T) => U): U[];
|
||
|
>map : <T, U>(items: T[], f: (x: T) => U) => U[]
|
||
|
>T : T
|
||
|
>U : U
|
||
|
>items : T[]
|
||
|
>T : T
|
||
|
>f : (x: T) => U
|
||
|
>x : T
|
||
|
>T : T
|
||
|
>U : U
|
||
|
>U : U
|
||
|
|
||
|
var myItems: string[];
|
||
|
>myItems : string[]
|
||
|
|
||
|
var lengths = map(myItems, x => x.length);
|
||
|
>lengths : number[]
|
||
|
>map(myItems, x => x.length) : number[]
|
||
|
>map : <T, U>(items: T[], f: (x: T) => U) => U[]
|
||
|
>myItems : string[]
|
||
|
>x => x.length : (x: string) => number
|
||
|
>x : string
|
||
|
>x.length : number
|
||
|
>x : string
|
||
|
>length : number
|
||
|
|
||
|
|