return 0['toString']['length'];
why does it return 1
return 0['toString']['length'];
why does it return 1
1000['toString'] gives you the function object Number.prototype.toString, and in JS, function objects have a property called length which returns the number of arguments the function takes. In this case is 1 because Number.prototype.toString receives a radix argument.
alert(Number.prototype.toString.length) // 1
References: