In JavaScript, which types support toString()? -


the good:

'hello'.tostring()    // "hello" let obj = {} obj.tostring()        // "[object object]" 

the bad:

undefined.tostring()  // throws typeerror null.tostring()       // throws typeerror 

are there other types throw on .tostring() method? thanks

every obj inherited object has string method.

starting javascript starting in javascript 1.8.5 tostring() called on null returns [object null], and undefined returns [objectundefined].

you can read more @ link: you can read more @ link


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -