The primitive value of the receiving object is returned by this method. Because an array is an aggregation of many elements, a simple type conversion is not appropriate. The individual elements are converted to string values and are then concatenated together and returned as a single string primitive value. This applies even if an array comprises a collection of numeric values.
See also: | valueOf() |
Prev | Home | Next |
Array.unshift() | Up | Array simulation |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |