interface Array < T > { first ( ) : T | undefined ; } if ( ! Array . prototype [ 'first' ] ) { Object . defineProperty ( Array . prototype , 'first' , { value : function ( ) { if ( this == null ) { throw new TypeError ( '"this" is null or not defined' ) ; } var o = Object ( this ) ; var len = o . length >>> 0 ; if ( len > 0 ) { return o [ 0 ] ; } return undefined ; } , configurable : true , writable : true , } ) ; }