.toString()

Term side of the Card
Topic: Object
Unit title: .toString()
Categories: Method
Explanation side of the Card

Explanation: The method that returns a string representing the object. By default, it returns '[object Type]', where 'Type' indicates the object's type, such as 'Object', 'Date', 'Number' or 'BigInt'. This method can be overridden to provide more meaningful output for custom objects.

Browser compatibility:
  • The chrome browser supports this feature starting from version 1
  • The edge browser supports this feature starting from version 12
  • The firefox browser supports this feature starting from version 1
  • The safari browser supports this feature starting from version 1
Availability: