S
sleepinglord
1.How to get the class of an object. or how to judge an object has the
same type of another.
for example. Array. How to judge an object is an Array object or not?
typeof() will return "object",
..isPrototypeOf() seems always return false or error.
for(a in Array.prototype) tell me, there's nothing in Array.prototype.
Then how to?
2.How to get the elements of an Array inside in a local function?
for example, I wanna add a toStrangeString () function to Array. The
code looks like this.
toStrangeString: function(){
var getELes = ?; //how to?
//compose the string and return
}
same type of another.
for example. Array. How to judge an object is an Array object or not?
typeof() will return "object",
..isPrototypeOf() seems always return false or error.
for(a in Array.prototype) tell me, there's nothing in Array.prototype.
Then how to?
2.How to get the elements of an Array inside in a local function?
for example, I wanna add a toStrangeString () function to Array. The
code looks like this.
toStrangeString: function(){
var getELes = ?; //how to?
//compose the string and return
}