Let's create class like:
var Klass = function() {} Klass.prototype { string: functioin() { /* return as string */ }, number: functioin() { /* return as number */ }, boolean: functioin() { /* return as string */ } };
This code use like:
var obj = new Klass(); obj[typeof any]() == any; // Yet another type casting
Enjoy!
No comments:
Post a Comment