Is there any way to use passed parameter to call function in javascript.
eg:
var Animal = (function(){
function Animal(type){
this.type(); eg this.snake(); if the parameter type is "snake"
}
return Animal;
})();
var animal = new Animal("snake");
Thanks!