I want to create a method for the String object that checks if it\'s undefined:
String
String.prototype.isDefined = (str) => typeof str === \'undefined\
No, you can't. undefined is not an object, it's a value.
undefined
You can't possibly write a function that checks if a string is undefined. If it's undefined, it's not a string. It's undefined.
I don't see what is not clean or readable with
function isDefined(x) { return x !== undefined; }