Export (0) Print
Expand All

Array Type Extensions

.NET Framework 3.5

Provides extensions to the base ECMAScript (JavaScript) Array functionality by adding static methods.

Namespace: None. This type extension is global and not part of a namespace.

Inherits: Array

var arrayVar = new Array("Saturn","Mars","Jupiter");
Array.add(arrayVar, "Earth");

Name

Description

Array.add Function

Adds an element to the end of an Array object.

Array.addRange Function

Copies all the elements of the specified array to the end of an Array object.

Array.clear Function

Removes all elements from an Array object.

Array.clone Function

Creates a shallow copy of an Array object.

Array.contains Function

Determines whether an element is in an Array object.

Array.dequeue Function

Removes the first element from an Array object.

Array.enqueue Function

Adds an element to the end of an Array object.

NoteNote:

Use the add function instead of the Array.enqueue function.

Array.forEach Function

Performs a specified action on each element of an Array object.

Array.indexOf Function

Searches for the specified element of an Array object and returns its index.

Array.insert Function

Inserts a value at the specified location in an Array object.

Array.parse Function

Creates an Array object from a string representation.

Array.remove Function

Removes the first occurrence of an element in an Array object.

Array.removeAt Function

Removes an element at the specified location in an Array object.

Array extensions are part of the Microsoft AJAX Library. They add static methods to the JavaScript Array object for additional functionality.

For more information about the JavaScript object that these static methods extend and about its constructor, see Array Object in the Language Reference.

The following example shows how to create a new Array object and invoke the Microsoft AJAX Library add function to add arrays as an element to a single array. The multidimensional array is then passed to a function that displays the array as a table in the document.

Community Additions

ADD
Show:
© 2014 Microsoft