How to listen to console.log?

Some like this:

If console.log((" some Word ")
… function(e) {…}, false);

Hi @Luis_Mb! Do you mean that you want to activate a function by typing something inside the console of the browser?

Yes. That’s posible?

Hi @Luis_Mb,

console.log() will always return null, so you can’t really listen to events on it. However, there are some hacky ways you might over come this. Here is what I found:

It is likely better to create your event based on whatever function that is actually creating the log does.

1 Like

Technically yes, if you override the console.log function. The only conceivable use for that is some kind of debugging. I’d definitely advise just triggering an event instead in place of the console log.

1 Like