Documentation for: ASP.NET Ajax Version 1.0

This documentation is for a previous version. For the current released version, see the ASP.NET Ajax documentation on MSDN.

 

 

 

 

 

 

 

Array.addRange Function

Copies all the elements of a specified Array object to the end of the array. This function is static and can be invoked without creating an instance of the object.

Syntax

Array.addRange(array, items);

Arguments

Term

Definition

array

The array to add items to.

items

The array of items to append.

Remarks

Use the addRange function to add all the elements of one array to the end of another array. If items contains an array without any items, the target array is unchanged and no exception is thrown.

note

In Mozilla Firefox version 2.0.0.1 and earlier, the Array.addRange and Array.clone functions might drop elements from the ends of large, sparse arrays.

Example

The following example shows how to append the elements of one array to another array by using the addRange function.

JavaScript

var a = ['a', 'b', 'c', 'd'];
var b = ['f', 'g','h'];
Array.addRange(a, b);
// View the results: "abcdefgh"
alert(a.toString());