I would am working on an app that's written in JavaScript. I'd like to extend that Console object. Is there a way do that? Currently, I have:
Console.prototype.execute = function() {
console.log('execute this...');
}
Then, in my code, I have:
console.execute();
When I run my page, I see the following in the console window:
Console is not defined
This implies I can't extend Console. What am I doing wrong?
consoleis extensible, you could just doconsole.execute = ...;.console.execute = function(){…};.Consolemodule which you could (but shouldn't) extend.