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.dequeue Function

Removes the first element from the specified Array object and returns it.

Syntax

var firstElement = Array.dequeue(array);

Arguments

Term

Definition

array

The array to remove the first element from.

Return Value

The first element of the array.

Remarks

Use the dequeue function to remove the first element from an Array object. The index value of the remaining elements in the array is reduced by one.

Example

The following example shows how to remove the first element from an array by using the dequeue function.

JavaScript

var myArray = [];
var result = "";
Array.add(myArray, 'a');
Array.add(myArray, 'b');
Array.add(myArray, 'c');
Array.add(myArray, 'd');
result = Array.dequeue(myArray);
// View the results: "b,c,d"
alert("Dequeue result: " + result + "myArray: " + myArray.toString());