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

JavaScript Basics

JavaScript Basics

JavaScript Intermediate

JavaScript Intermediate

JavaScript Advanced

JavaScript Advanced

JavaScript Reference

JavaScript Entities

Globals

Object

Class Properties
prototype
Instance Properties
constructor
Class Methods
None.
Instance Methods Getters
hasOwnProperty()
isPrototypeOf()
toLocaleString()
toString()
valueOf()
Instance Methods Setters
None.

Statements

Operators