Does anyone know how to retrieve the type of an object under the prototype property? For example, consider the following code:
Object.prototype.someproperty = function(){
...do something...
console.log(typeof this);
..more...
}
In my code, "Function" always results because the constructor of objects is a function. When I call it like this:
Array.someproperty(); //In this case, I want to get "array"
//or
String.someproperty(); //In this case, I want to get "string"
Instead of getting "function", I want to retrieve "Array"... Does anyone have a solution for this?