TypeScript/tests/baselines/reference/stringPropertyAccess.types
2015-04-15 16:44:20 -07:00

38 lines
853 B
Plaintext

=== tests/cases/conformance/types/primitives/string/stringPropertyAccess.ts ===
var x = '';
>x : string
>'' : string
var a = x.charAt(0);
>a : string
>x.charAt(0) : string
>x.charAt : (pos: number) => string
>x : string
>charAt : (pos: number) => string
>0 : number
var b = x.hasOwnProperty('charAt');
>b : boolean
>x.hasOwnProperty('charAt') : boolean
>x.hasOwnProperty : (v: string) => boolean
>x : string
>hasOwnProperty : (v: string) => boolean
>'charAt' : string
var c = x['charAt'](0);
>c : string
>x['charAt'](0) : string
>x['charAt'] : (pos: number) => string
>x : string
>'charAt' : string
>0 : number
var e = x['hasOwnProperty']('toFixed');
>e : boolean
>x['hasOwnProperty']('toFixed') : boolean
>x['hasOwnProperty'] : (v: string) => boolean
>x : string
>'hasOwnProperty' : string
>'toFixed' : string