var foo = 123 ; var bar = foo . toString ( ) ; var test = window ; interface Window { helloWorld ( ) : void ; } window . helloWorld = ( ) => console . log ( 'hello world' ) ; window . helloWorld ( ) ; interface Math { seedrandom ( seed ? ) ; } Math . seedrandom ( ) ; Date . parse ; interface Date { } interface String { endsWith ( suffix ) : boolean ; } String . prototype . endsWith = function ( suffix ) : boolean { var str = this ; return str && str . indexOf ( suffix , str . length - suffix . length ) !== - 1 ; } ; console . log ( 'foo bar' . endsWith ( 'bas' ) ) ; console . log ( 'foo bas' . endsWith ( 'bas' ) ) ;