Child pages
  • Array

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Div
styledisplay:none

DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.

Enter additional information related to this 'class' inside the {div} macro with 'id=description'

Div
iddescription



HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Row (tr)
Table Cell (td)
Object
Table Cell (td)
[index]
Get an element by index.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
length
Get the length of the array.



HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
concat(value1)
Returns a new array comprised of this array joined with other array(s) and/or value(s).
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
concat(value1, value2)
Returns a new array comprised of this array joined with other array(s) and/or value(s).
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
concat(value1, value2, valueN)
Returns a new array comprised of this array joined with other array(s) and/or value(s).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
every(callback)
Runs a function on items in the array while that function is returning true.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
every(callback, thisObject)
Runs a function on items in the array while that function is returning true.
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
filter(callback)
Runs a function on every item in the array and returns an array of all items for which the function returns true.
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
filter(callback, thisObject)
Runs a function on every item in the array and returns an array of all items for which the function returns true.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
forEach(callback)
Runs a function (callback) on every item in the array.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
forEach(callback, thisObject)
Runs a function (callback) on every item in the array.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
indexOf(searchElement)
Returns the first index at which a given element can be found in the array, or -1 if it is not present.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
indexOf(searchElement, fromIndex)
Returns the first index at which a given element can be found in the array, or -1 if it is not present.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
isArray(obj)
Checks whether an object is an array or not.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
join(delimiter)
Puts all elements in the array into a string, separating each element with the specified delimiter
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
lastIndexOf(searchElement)
Returns the last index at which a given element can be found in the array, or -1 if it is not present.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
lastIndexOf(searchElement, fromIndex)
Returns the last index at which a given element can be found in the array, or -1 if it is not present.
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
map(callback)
Runs a function on every item in the array and returns the results in an array.
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
map(callback, thisObject)
Runs a function on every item in the array and returns the results in an array.
Table Row (tr)
Table Cell (td)
Object
Table Cell (td)
pop()
Pops the last string off the array and returns it.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
push(value1)
Mutates an array by appending the given elements and returning the new length of the array.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
push(value1, value2)
Mutates an array by appending the given elements and returning the new length of the array.
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
push(value1, value2, valueN)
Mutates an array by appending the given elements and returning the new length of the array.
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
reverse()
Puts array elements in reverse order.
Table Row (tr)
Table Cell (td)
Object
Table Cell (td)
shift()
Decreases array element size by one by shifting the first element off the array and returning it.
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
slice(begin)
The slice method creates a new array from a selected section of an array.
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
slice(begin, end)
The slice method creates a new array from a selected section of an array.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
some(callback)
Runs a function on items in the array while that function returns false.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
some(callback, thisObject)
Runs a function on items in the array while that function returns false.
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
sort()
Sorts the array elements in dictionary order or using a compare function passed to the method.
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
sort(function)
Sorts the array elements in dictionary order or using a compare function passed to the method.
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
splice(arrayIndex, length)
It is used to take elements out of an array and replace them with those specified.
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
splice(arrayIndex, length, value1)
It is used to take elements out of an array and replace them with those specified.
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
splice(arrayIndex, length, value1, value2)
It is used to take elements out of an array and replace them with those specified.
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
splice(arrayIndex, length, value1, value2, valueN)
It is used to take elements out of an array and replace them with those specified.
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
unshift(value1, value2, valueN)
Places element data at the start of an array.



HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Details
Table Body (tbody)
id[index]
Table Row (tr)
idname
Table Cell (td)

[index]

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get an element by index.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Object
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
array[0]
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idlength
Table Row (tr)
idname
Table Cell (td)

length

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the length of the array.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
array.length
Table Row (tr)
classlastDetailRow
Table Cell (td)
 



HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
idconcat-Object
Table Row (tr)
idname
Table Cell (td)

concat

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
concat
Span
(value1)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns a new array comprised of this array joined with other array(s) and/or value(s).
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value1
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
array.concat();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idconcat-Object_Object
Table Row (tr)
idname
Table Cell (td)

concat

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
concat
Span
(value1, value2)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns a new array comprised of this array joined with other array(s) and/or value(s).
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value1
{Object} value2
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
array.concat();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idconcat-Object_Object_Object
Table Row (tr)
idname
Table Cell (td)

concat

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
concat
Span
(value1, value2, valueN)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns a new array comprised of this array joined with other array(s) and/or value(s).
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value1
{Object} value2
{Object} valueN
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
array.concat();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idevery-Function
Table Row (tr)
idname
Table Cell (td)

every

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
every
Span
(callback)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Runs a function on items in the array while that function is returning true. It returns true if the function returns true for every item it could visit.
The callback function is invoked with three arguments: the element value, the element index, the array being traversed.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Function} callback
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
function isNumber(value) { return typeof value == 'number'; }
var a1 = [1, 2, 3];
application.output(a1.every(isNumber));
var a2 = [1, '2', 3];
application.output(a2.every(isNumber));
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idevery-Function_Array
Table Row (tr)
idname
Table Cell (td)

every

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
every
Span
(callback, thisObject)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Runs a function on items in the array while that function is returning true. It returns true if the function returns true for every item it could visit.
The callback function is invoked with three arguments: the element value, the element index, the array being traversed.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Function} callback
{Array} thisObject
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
function isNumber(value) { return typeof value == 'number'; }
var a1 = [1, 2, 3];
application.output(a1.every(isNumber));
var a2 = [1, '2', 3];
application.output(a2.every(isNumber));
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idfilter-Function
Table Row (tr)
idname
Table Cell (td)

filter

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
filter
Span
(callback)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Runs a function on every item in the array and returns an array of all items for which the function returns true.
The callback function is invoked with three arguments: the element value, the element index, the array being traversed.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Function} callback
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var a1 = ['a', 10, 'b', 20, 'c', 30];
var a2 = a1.filter(function(item) { return typeof item == 'number'; });
application.output(a2);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idfilter-Function_Array
Table Row (tr)
idname
Table Cell (td)

filter

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
filter
Span
(callback, thisObject)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Runs a function on every item in the array and returns an array of all items for which the function returns true.
The callback function is invoked with three arguments: the element value, the element index, the array being traversed.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Function} callback
{Array} thisObject
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var a1 = ['a', 10, 'b', 20, 'c', 30];
var a2 = a1.filter(function(item) { return typeof item == 'number'; });
application.output(a2);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idforEach-Function
Table Row (tr)
idname
Table Cell (td)

forEach

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
forEach
Span
(callback)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Runs a function (callback) on every item in the array. The callback function is invoked only for indexes of the array which have assigned values.
The callback function is invoked with three arguments: the element value, the element index, the array being traversed.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Function} callback
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
function printThemOut(element, index, array) {
		application.output("a[" + index + "] = " + element);
}
var a = ['a', 'b', 'c'];
a.forEach(printThemOut);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idforEach-Function_Object
Table Row (tr)
idname
Table Cell (td)

forEach

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
forEach
Span
(callback, thisObject)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Runs a function (callback) on every item in the array. The callback function is invoked only for indexes of the array which have assigned values.
The callback function is invoked with three arguments: the element value, the element index, the array being traversed.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Function} callback
{Object} thisObject
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
function printThemOut(element, index, array) {
		application.output("a[" + index + "] = " + element);
}
var a = ['a', 'b', 'c'];
a.forEach(printThemOut);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idindexOf-Object
Table Row (tr)
idname
Table Cell (td)

indexOf

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
indexOf
Span
(searchElement)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the first index at which a given element can be found in the array, or -1 if it is not present.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} searchElement
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var a = ['a', 'b', 'a', 'b', 'a'];
application.output(a.indexOf('b'));
application.output(a.indexOf('b', 2));
application.output(a.indexOf('z'));
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idindexOf-Object_Number
Table Row (tr)
idname
Table Cell (td)

indexOf

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
indexOf
Span
(searchElement, fromIndex)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the first index at which a given element can be found in the array, or -1 if it is not present.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} searchElement
{Number} fromIndex
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var a = ['a', 'b', 'a', 'b', 'a'];
application.output(a.indexOf('b'));
application.output(a.indexOf('b', 2));
application.output(a.indexOf('z'));
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idisArray-Object
Table Row (tr)
idname
Table Cell (td)

isArray

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
isArray
Span
(obj)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Checks whether an object is an array or not.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} obj
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var a = [1, 2, 3];
application.output(Array.isArray(a)); //prints true
application.output(Array.isArray(23)); //prints false
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idjoin-String
Table Row (tr)
idname
Table Cell (td)

join

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
join
Span
(delimiter)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Puts all elements in the array into a string, separating each element with the specified delimiter
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} delimiter
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var words = new Array("limit","lines","finish","complete","In","Out");
var jwords = words.join(";");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idlastIndexOf-Object
Table Row (tr)
idname
Table Cell (td)

lastIndexOf

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
lastIndexOf
Span
(searchElement)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the last index at which a given element can be found in the array, or -1 if it is not present. The array is searched backwards, starting at fromIndex.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} searchElement
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var a = ['a', 'b', 'c', 'd', 'a', 'b'];
application.output(a.lastIndexOf('b'));
application.output(a.lastIndexOf('b', 4));
application.output(a.lastIndexOf('z'));
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idlastIndexOf-Object_Number
Table Row (tr)
idname
Table Cell (td)

lastIndexOf

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
lastIndexOf
Span
(searchElement, fromIndex)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the last index at which a given element can be found in the array, or -1 if it is not present. The array is searched backwards, starting at fromIndex.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} searchElement
{Number} fromIndex
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var a = ['a', 'b', 'c', 'd', 'a', 'b'];
application.output(a.lastIndexOf('b'));
application.output(a.lastIndexOf('b', 4));
application.output(a.lastIndexOf('z'));
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idmap-Object
Table Row (tr)
idname
Table Cell (td)

map

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
map
Span
(callback)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Runs a function on every item in the array and returns the results in an array.
The callback function is invoked with three arguments: the element value, the element index, the array being traversed.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} callback
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var a = ['a', 'b', 'c'];
var a2 = a.map(function(item) { return item.toUpperCase(); });
application.output(a2);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idmap-Object_Array
Table Row (tr)
idname
Table Cell (td)

map

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
map
Span
(callback, thisObject)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Runs a function on every item in the array and returns the results in an array.
The callback function is invoked with three arguments: the element value, the element index, the array being traversed.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} callback
{Array} thisObject
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var a = ['a', 'b', 'c'];
var a2 = a.map(function(item) { return item.toUpperCase(); });
application.output(a2);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idpop
Table Row (tr)
idname
Table Cell (td)

pop

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Object
Span
stylefont-weight: bold;
pop
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Pops the last string off the array and returns it.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Object
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var words = new Array("limit","lines","finish","complete","In","Out");
var lastword = words.pop();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idpush-Object
Table Row (tr)
idname
Table Cell (td)

push

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
push
Span
(value1)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Mutates an array by appending the given elements and returning the new length of the array.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value1
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var words = new Array("limit","lines","finish","complete");
words.push("In","Out");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idpush-Object_Object
Table Row (tr)
idname
Table Cell (td)

push

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
push
Span
(value1, value2)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Mutates an array by appending the given elements and returning the new length of the array.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value1
{Object} value2
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var words = new Array("limit","lines","finish","complete");
words.push("In","Out");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idpush-Object_Object_Object
Table Row (tr)
idname
Table Cell (td)

push

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
push
Span
(value1, value2, valueN)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Mutates an array by appending the given elements and returning the new length of the array.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value1
{Object} value2
{Object} valueN
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Number
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var words = new Array("limit","lines","finish","complete");
words.push("In","Out");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idreverse
Table Row (tr)
idname
Table Cell (td)

reverse

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
reverse
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Puts array elements in reverse order.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var words = new Array("limit","lines","finish","complete","In","Out");
words.reverse();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idshift
Table Row (tr)
idname
Table Cell (td)

shift

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Object
Span
stylefont-weight: bold;
shift
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Decreases array element size by one by shifting the first element off the array and returning it.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Object
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var words = new Array("limit","lines","finish","complete","In","Out");
words.shift();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idslice-Object
Table Row (tr)
idname
Table Cell (td)

slice

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
slice
Span
(begin)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
The slice method creates a new array from a selected section of an array.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} begin
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var words = new Array("limit","lines","finish","complete","In","Out");
var nwords1 = words.slice(3, 5);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idslice-Object_Object
Table Row (tr)
idname
Table Cell (td)

slice

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
slice
Span
(begin, end)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
The slice method creates a new array from a selected section of an array.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} begin
{Object} end
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var words = new Array("limit","lines","finish","complete","In","Out");
var nwords1 = words.slice(3, 5);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsome-Function
Table Row (tr)
idname
Table Cell (td)

some

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
some
Span
(callback)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Runs a function on items in the array while that function returns false. It returns true if the function returns true for any item it could visit.
The callback function is invoked with three arguments: the element value, the element index, the array being traversed.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Function} callback
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
function isNumber(value) { return typeof value == 'number'; }
var a1 = [1, 2, 3];
application.output(a1.some(isNumber));
var a2 = [1, '2', 3];
application.output(a2.some(isNumber));
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsome-Function_Array
Table Row (tr)
idname
Table Cell (td)

some

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
some
Span
(callback, thisObject)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Runs a function on items in the array while that function returns false. It returns true if the function returns true for any item it could visit.
The callback function is invoked with three arguments: the element value, the element index, the array being traversed.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Function} callback
{Array} thisObject
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
function isNumber(value) { return typeof value == 'number'; }
var a1 = [1, 2, 3];
application.output(a1.some(isNumber));
var a2 = [1, '2', 3];
application.output(a2.some(isNumber));
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsort
Table Row (tr)
idname
Table Cell (td)

sort

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
sort
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Sorts the array elements in dictionary order or using a compare function passed to the method.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var words = new Array("limit","lines","finish","complete","In","Out");
words.sort();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsort-Function
Table Row (tr)
idname
Table Cell (td)

sort

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
sort
Span
(function)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Sorts the array elements in dictionary order or using a compare function passed to the method.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Function} function
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var words = new Array("limit","lines","finish","complete","In","Out");
words.sort();
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsplice-Object_Object
Table Row (tr)
idname
Table Cell (td)

splice

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
splice
Span
(arrayIndex, length)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
It is used to take elements out of an array and replace them with those specified.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arrayIndex
{Object} length
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var words = new Array("limit","lines","finish","complete","In","Out");
var nwords1 = words.splice(3, 2, "done", "On");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsplice-Object_Object_Object
Table Row (tr)
idname
Table Cell (td)

splice

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
splice
Span
(arrayIndex, length, value1)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
It is used to take elements out of an array and replace them with those specified.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arrayIndex
{Object} length
{Object} value1
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var words = new Array("limit","lines","finish","complete","In","Out");
var nwords1 = words.splice(3, 2, "done", "On");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsplice-Object_Object_Object_Object
Table Row (tr)
idname
Table Cell (td)

splice

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
splice
Span
(arrayIndex, length, value1, value2)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
It is used to take elements out of an array and replace them with those specified.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arrayIndex
{Object} length
{Object} value1
{Object} value2
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var words = new Array("limit","lines","finish","complete","In","Out");
var nwords1 = words.splice(3, 2, "done", "On");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsplice-Object_Object_Object_Object_Object
Table Row (tr)
idname
Table Cell (td)

splice

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
splice
Span
(arrayIndex, length, value1, value2, valueN)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
It is used to take elements out of an array and replace them with those specified.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} arrayIndex
{Object} length
{Object} value1
{Object} value2
{Object} valueN
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var words = new Array("limit","lines","finish","complete","In","Out");
var nwords1 = words.splice(3, 2, "done", "On");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idunshift-Object_Object_Object
Table Row (tr)
idname
Table Cell (td)

unshift

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Array
Span
stylefont-weight: bold;
unshift
Span
(value1, value2, valueN)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Places element data at the start of an array.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} value1
{Object} value2
{Object} valueN
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var words = new Array("finish","complete","In","Out");
words.unshift("limit","lines");
Table Row (tr)
classlastDetailRow
Table Cell (td)