Object toString() method

Find out all the information about the JavaScript toString() method of the object

Called on an object instance and returns the string representation of the object. return[object Object]String, unless overwritten. The object can then return its own string representation.

const person = { name: 'Fred' }
person.toString() //[object Object]

Download mine for freeJavaScript beginner's manual


More js tutorials: