The Object toString() method
By Flavio Copes
Learn how the JavaScript toString() method returns a string representation of an object, defaulting to [object Object] unless you override it yourself.
~~~
Called on an object instance, returns a string representation of the object.
Returns the [object Object] string unless overridden. Objects can then return a string representation of themselves.
const person = { name: 'Fred' }
person.toString() //[object Object] ~~~
Related posts about js: