My goal is to create a custom log
method for the String object that will print out the actual string value, but I'm facing some difficulties in getting it to work correctly.
String.prototype.log = function() {
console.log(this.valueOf());
}
'Print Me'.log(); // [object Window]
I need help figuring out how to make it log 'Print Me' instead of '[object Window]'. Any suggestions?