String.prototype.endsWith.call({toString:function(){return null;}}, "null") even better