Somebody
Somebody

Reputation: 9645

Nodejs: __call implementation available?

I need at least such feature atm:

function ExampleClass() {
}

ExampleClass.prototype.__noSuchMethod__ = function() {
  console.log("No such method, maybe you should try reading the docs?");
}

example = new ExampleClass();
example.eatPizza();

Isn't it implemented yet in v8 or anyhow emulated else?

Have anyone implemented such feature on their projects?

Thanks

Upvotes: 4

Views: 2445

Answers (1)

alessioalex
alessioalex

Reputation: 63683

There was a similar question on StackOverflow, you can find the answer there:

Capture method missing in Javascript and do some logic?

Upvotes: 2

Related Questions