var v = new Array('Bill','Erik','Pam');
v.toString();
v.constructor;
In Firebug 1.7.3, FF 5.0.1
v.constructor //Returns "undefined, not Array();
also:
var s = new String('Couch Potato');
s.indexOf('Couch');
s.slice(1,5);
s.split(" ");
s.join(' '); //FF returns "s.join" is not a function.
Why is this?
For the constructor property, apparently firebug has a bug. try alerting that value (
alert([].constructor)) and you’ll see that it is notundefined.The
joinmethod is an array method and it’s normal for firebug to show an error when calling it on a string. In javascript, theStringis not an array ofcharlike in other languages (probably you got confused).The only way you can call the
joinmethod in your case would be after you transformed your string into an array :"abcd".split('').join('').