toLocaleString()  Object  instance method JS Home  <<  JS Reference  <<  Object  <<  toLocaleString()

Description

Returns a string of the specified object by calling the toString() method of Object.

  • The purpose of toLocaleString() is for custom objects to override the method for locale-specific needs.
  • The Array, Date and Number 1.5 global objects override the toLocaleString() method.
  • Unless overridden by a custom object toString returns [object objectType].

Syntax

Signature Description
anObject.toLocaleString()Returns a string of the specified object by calling the toString() method of Object.

Parameters

None.

Examples

See the toString() method of Object method for override details.

Related Tutorials

JavaScript Basic Tutorials - Lesson 7 - Objects