Availability
JavaScript 1.2; JScript 3.0; ECMAScript v3
Synopsis
array.concat(value, ...)
Arguments
value, ...
Any number of values to be concatenated with
array.
Returns
A new array, which is formed by concatenating each of the specified
arguments to array.
Description
concat( ) creates and returns a new array that is
the result of concatenating each of its arguments to
array. It does not modify
array. If any of the arguments to
concat( ) is itself an array, the elements of that
array are concatenated, rather than the array itself.
Example
var a = [1,2,3];
a.concat(4, 5) // Returns [1,2,3,4,5]
a.concat([4,5]); // Returns [1,2,3,4,5]
a.concat([4,5],[6,7]) // Returns [1,2,3,4,5,6,7]
a.concat(4, [5,[6,7]]) // Returns [1,2,3,4,5,[6,7]
See Also
Array.join( ), Array.push( ), Array.splice( )
•
Table of Contents
•
Index
•
Reviews
•
Examples
•
Reader Reviews
•
Errata
JavaScript: The Definitive Guide, 4th Edition
By
David Flanagan
Publisher
: O'Reilly
Pub Date
: November 2001
ISBN
: 0-596-00048-0
Pages
: 936
Slots
: 1
This fourth edition of the definitive reference to
JavaScript, a scripting language that can be embedded
directly in web pages, covers the latest version of the
language, JavaScript 1.5, as supported by Netscape 6 and
Internet Explorer 6. The book also provides complete
coverage of the W3C DOM standard (Level 1 and Level 2),
while retaining material on the legacy Level 0 DOM for
backward compatibility.