method missing - Can I get Ruby's method_missing behavior in typescript? -
if class not implement method, want handle error raised , inject own code, using method name.
for example:
class foo { def method_missing(methodname) { console.log(`${methodname} called`); } } let foo = new foo(); foo.bar(); // should print 'bar called' in console in ruby, there method called method_missing on every class provides behavior. can in typescript, , how?
no, typescript cannot this.
Comments
Post a Comment