Child pages
  • Array

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
{div:style=display: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}
{div:id=description}{div}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[Object]{td}{td}[\[index\]|#\[index\]]
Get an element by index.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#length]
Get the length of the array.{td}{tr}{tbody}{table}\\ 

{table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[Array]{td}{td}[#concat]\(value1)
Returns a new array comprised of this array joined with other array(s) and/or value(s).{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{td}[#concat]\(value1, value2)
Returns a new array comprised of this array joined with other array(s) and/or value(s).{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{td}[#concat]\(value1, value2, valueN)
Returns a new array comprised of this array joined with other array(s) and/or value(s).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#every]\(callback)
Runs a function on items in the array while that function is returning true.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#every]\(callback, thisObject)
Runs a function on items in the array while that function is returning true.{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{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.{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{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.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#forEach]\(callback)
Runs a function (callback) on every item in the array.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#forEach]\(callback, thisObject)
Runs a function (callback) on every item in the array.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{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.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{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.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#isArray]\(obj)
Checks whether an object is an array or not.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#join]\(delimiter)
Puts all elements in the array into a string, separating each element with the specified delimiter{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{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.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{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.{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{td}[#map]\(callback)
Runs a function on every item in the array and returns the results in an array.{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{td}[#map]\(callback, thisObject)
Runs a function on every item in the array and returns the results in an array.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#pop]\()
Pops the last string off the array and returns it.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#push]\(value1)
Mutates an array by appending the given elements and returning the new length of the array.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#push]\(value1, value2)
Mutates an array by appending the given elements and returning the new length of the array.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#push]\(value1, value2, valueN)
Mutates an array by appending the given elements and returning the new length of the array.{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{td}[#reverse]\()
Puts array elements in reverse order.{td}{tr}{tbody}{tbody}{tr}{td}[Object]{td}{td}[#shift]\()
Decreases array element size by one by shifting the first element off the array and returning it.{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{td}[#slice]\(begin)
The slice method creates a new array from a selected section of an array.{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{td}[#slice]\(begin, end)
The slice method creates a new array from a selected section of an array.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#some]\(callback)
Runs a function on items in the array while that function returns false.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#some]\(callback, thisObject)
Runs a function on items in the array while that function returns false.{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{td}[#sort]\()
Sorts the array elements in dictionary order or using a compare function passed to the method.{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{td}[#sort]\(function)
Sorts the array elements in dictionary order or using a compare function passed to the method.{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{td}[#splice]\(arrayIndex, length)
It is used to take elements out of an array and replace them with those specified.{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{td}[#splice]\(arrayIndex, length, value1)
It is used to take elements out of an array and replace them with those specified.{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{td}[#splice]\(arrayIndex, length, value1, value2)
It is used to take elements out of an array and replace them with those specified.{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{td}[#splice]\(arrayIndex, length, value1, value2, valueN)
It is used to take elements out of an array and replace them with those specified.{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{td}[#unshift]\(value1, value2, valueN)
Places element data at the start of an array.{td}{tr}{tbody}{table}\\ 

{table:id=property|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=[index]}{tr:id=name}{td}h6.\[index\]{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get an element by index.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Object]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
array[0]
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=length}{tr:id=name}{td}h6.length{td}{tr}{tr:id=des}{td}{div:class=sIndent}Get the length of the array.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
array.length
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ 

{table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=concat-Object}{tr:id=name}{td}h6.concat{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}concat{span}{span}\(value1){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Returns a new array comprised of this array joined with other array(s) and/or value(s).{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value1
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
array.concat();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=concat-Object_Object}{tr:id=name}{td}h6.concat{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}concat{span}{span}\(value1, value2){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Returns a new array comprised of this array joined with other array(s) and/or value(s).{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value1
\{[Object]} value2
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
array.concat();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=concat-Object_Object_Object}{tr:id=name}{td}h6.concat{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}concat{span}{span}\(value1, value2, valueN){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Returns a new array comprised of this array joined with other array(s) and/or value(s).{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value1
\{[Object]} value2
\{[Object]} valueN
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
array.concat();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=every-Function}{tr:id=name}{td}h6.every{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}every{span}{span}\(callback){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Function]} callback
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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));
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=every-Function_Array}{tr:id=name}{td}h6.every{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}every{span}{span}\(callback, thisObject){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Function]} callback
\{[Array]} thisObject
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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));
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=filter-Function}{tr:id=name}{td}h6.filter{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}filter{span}{span}\(callback){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Function]} callback
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var a1 = ['a', 10, 'b', 20, 'c', 30];
var a2 = a1.filter(function(item) { return typeof item == 'number'; });
application.output(a2);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=filter-Function_Array}{tr:id=name}{td}h6.filter{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}filter{span}{span}\(callback, thisObject){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Function]} callback
\{[Array]} thisObject
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var a1 = ['a', 10, 'b', 20, 'c', 30];
var a2 = a1.filter(function(item) { return typeof item == 'number'; });
application.output(a2);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=forEach-Function}{tr:id=name}{td}h6.forEach{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}forEach{span}{span}\(callback){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Function]} callback
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
function printThemOut(element, index, array) {
		application.output("a[" + index + "] = " + element);
}
var a = ['a', 'b', 'c'];	
a.forEach(printThemOut);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=forEach-Function_Object}{tr:id=name}{td}h6.forEach{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}forEach{span}{span}\(callback, thisObject){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Function]} callback
\{[Object]} thisObject
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
function printThemOut(element, index, array) {
		application.output("a[" + index + "] = " + element);
}
var a = ['a', 'b', 'c'];	
a.forEach(printThemOut);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=indexOf-Object}{tr:id=name}{td}h6.indexOf{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}indexOf{span}{span}\(searchElement){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Returns the first index at which a given element can be found in the array, or \-1 if it is not present.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} searchElement
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var a = ['a', 'b', 'a', 'b', 'a'];
application.output(a.indexOf('b'));
application.output(a.indexOf('b', 2));
application.output(a.indexOf('z'));
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=indexOf-Object_Number}{tr:id=name}{td}h6.indexOf{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}indexOf{span}{span}\(searchElement, fromIndex){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Returns the first index at which a given element can be found in the array, or \-1 if it is not present.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} searchElement
\{[Number]} fromIndex
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var a = ['a', 'b', 'a', 'b', 'a'];
application.output(a.indexOf('b'));
application.output(a.indexOf('b', 2));
application.output(a.indexOf('z'));
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=isArray-Object}{tr:id=name}{td}h6.isArray{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}isArray{span}{span}\(obj){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Checks whether an object is an array or not.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} obj
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var a = [1, 2, 3];
application.output(Array.isArray(a)); //prints true
application.output(Array.isArray(23)); //prints false
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=join-String}{tr:id=name}{td}h6.join{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}join{span}{span}\(delimiter){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Puts all elements in the array into a string, separating each element with the specified delimiter{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} delimiter
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var words = new Array("limit","lines","finish","complete","In","Out");
var jwords = words.join(";");
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=lastIndexOf-Object}{tr:id=name}{td}h6.lastIndexOf{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}lastIndexOf{span}{span}\(searchElement){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} searchElement
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var a = ['a', 'b', 'c', 'd', 'a', 'b'];
application.output(a.lastIndexOf('b'));
application.output(a.lastIndexOf('b', 4));
application.output(a.lastIndexOf('z'));
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=lastIndexOf-Object_Number}{tr:id=name}{td}h6.lastIndexOf{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}lastIndexOf{span}{span}\(searchElement, fromIndex){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} searchElement
\{[Number]} fromIndex
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var a = ['a', 'b', 'c', 'd', 'a', 'b'];
application.output(a.lastIndexOf('b'));
application.output(a.lastIndexOf('b', 4));
application.output(a.lastIndexOf('z'));
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=map-Object}{tr:id=name}{td}h6.map{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}map{span}{span}\(callback){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} callback
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var a = ['a', 'b', 'c'];	
var a2 = a.map(function(item) { return item.toUpperCase(); });	
application.output(a2);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=map-Object_Array}{tr:id=name}{td}h6.map{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}map{span}{span}\(callback, thisObject){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} callback
\{[Array]} thisObject
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var a = ['a', 'b', 'c'];	
var a2 = a.map(function(item) { return item.toUpperCase(); });	
application.output(a2);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=pop}{tr:id=name}{td}h6.pop{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Object]{span}{span:style=font-weight: bold;}pop{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Pops the last string off the array and returns it.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Object]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var words = new Array("limit","lines","finish","complete","In","Out");
var lastword = words.pop();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=push-Object}{tr:id=name}{td}h6.push{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}push{span}{span}\(value1){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Mutates an array by appending the given elements and returning the new length of the array.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value1
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var words = new Array("limit","lines","finish","complete");
words.push("In","Out");
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=push-Object_Object}{tr:id=name}{td}h6.push{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}push{span}{span}\(value1, value2){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Mutates an array by appending the given elements and returning the new length of the array.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value1
\{[Object]} value2
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var words = new Array("limit","lines","finish","complete");
words.push("In","Out");
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=push-Object_Object_Object}{tr:id=name}{td}h6.push{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}push{span}{span}\(value1, value2, valueN){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Mutates an array by appending the given elements and returning the new length of the array.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value1
\{[Object]} value2
\{[Object]} valueN
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var words = new Array("limit","lines","finish","complete");
words.push("In","Out");
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=reverse}{tr:id=name}{td}h6.reverse{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}reverse{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Puts array elements in reverse order.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var words = new Array("limit","lines","finish","complete","In","Out");
words.reverse();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=shift}{tr:id=name}{td}h6.shift{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Object]{span}{span:style=font-weight: bold;}shift{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Decreases array element size by one by shifting the first element off the array and returning it.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Object]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var words = new Array("limit","lines","finish","complete","In","Out");
words.shift();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=slice-Object}{tr:id=name}{td}h6.slice{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}slice{span}{span}\(begin){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}The slice method creates a new array from a selected section of an array.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} begin
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var words = new Array("limit","lines","finish","complete","In","Out");
var nwords1 = words.slice(3, 5);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=slice-Object_Object}{tr:id=name}{td}h6.slice{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}slice{span}{span}\(begin, end){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}The slice method creates a new array from a selected section of an array.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} begin
\{[Object]} end
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var words = new Array("limit","lines","finish","complete","In","Out");
var nwords1 = words.slice(3, 5);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=some-Function}{tr:id=name}{td}h6.some{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}some{span}{span}\(callback){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Function]} callback
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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));
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=some-Function_Array}{tr:id=name}{td}h6.some{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}some{span}{span}\(callback, thisObject){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Function]} callback
\{[Array]} thisObject
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
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));
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sort}{tr:id=name}{td}h6.sort{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}sort{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Sorts the array elements in dictionary order or using a compare function passed to the method.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var words = new Array("limit","lines","finish","complete","In","Out");
words.sort();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sort-Function}{tr:id=name}{td}h6.sort{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}sort{span}{span}\(function){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Sorts the array elements in dictionary order or using a compare function passed to the method.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Function]} function
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var words = new Array("limit","lines","finish","complete","In","Out");
words.sort();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=splice-Object_Object}{tr:id=name}{td}h6.splice{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}splice{span}{span}\(arrayIndex, length){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}It is used to take elements out of an array and replace them with those specified.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} arrayIndex
\{[Object]} length
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var words = new Array("limit","lines","finish","complete","In","Out");
var nwords1 = words.splice(3, 2, "done", "On");
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=splice-Object_Object_Object}{tr:id=name}{td}h6.splice{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}splice{span}{span}\(arrayIndex, length, value1){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}It is used to take elements out of an array and replace them with those specified.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} arrayIndex
\{[Object]} length
\{[Object]} value1
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var words = new Array("limit","lines","finish","complete","In","Out");
var nwords1 = words.splice(3, 2, "done", "On");
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=splice-Object_Object_Object_Object}{tr:id=name}{td}h6.splice{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}splice{span}{span}\(arrayIndex, length, value1, value2){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}It is used to take elements out of an array and replace them with those specified.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} arrayIndex
\{[Object]} length
\{[Object]} value1
\{[Object]} value2
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var words = new Array("limit","lines","finish","complete","In","Out");
var nwords1 = words.splice(3, 2, "done", "On");
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=splice-Object_Object_Object_Object_Object}{tr:id=name}{td}h6.splice{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}splice{span}{span}\(arrayIndex, length, value1, value2, valueN){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}It is used to take elements out of an array and replace them with those specified.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} arrayIndex
\{[Object]} length
\{[Object]} value1
\{[Object]} value2
\{[Object]} valueN
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var words = new Array("limit","lines","finish","complete","In","Out");
var nwords1 = words.splice(3, 2, "done", "On");
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=unshift-Object_Object_Object}{tr:id=name}{td}h6.unshift{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Array]{span}{span:style=font-weight: bold;}unshift{span}{span}\(value1, value2, valueN){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Places element data at the start of an array.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} value1
\{[Object]} value2
\{[Object]} valueN
{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var words = new Array("finish","complete","In","Out");
words.unshift("limit","lines");
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}