Please use String.prototype, instead of creating an empty string.

Also, wouldn't the typeError be thrown on `'foo'.startsWith(null)`? you shouldn't need to check the type of "this"