# Class Array

- [TopLevel.Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - [TopLevel.Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md)

An Array of items.

## Property Summary

| Property                                                                                              | Description              |
| ----------------------------------------------------------------------------------------------------- | ------------------------ |
| [length](#length): [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md) | The length of the Array. |

## Constructor Summary

| Constructor                                                                                                  | Description                                     |
| ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------- |
| [Array](#array)()                                                                                            | Constructs an Array.                            |
| [Array](#arraynumber)([Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md))    | Constructs an Array of the specified  length.   |
| [Array](#arrayobject)([Object...](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)) | Constructs an Array using the specified values. |

## Method Summary

| Method                                                                                                                                                                                                                                                                                                                                                                            | Description                                                                                                                                                 |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [concat](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#concatobject)([Object...](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))                                                                                                                                                                                             | Constructs an Array by concatenating multiple values.                                                                                                       |
| [copyWithin](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#copywithinnumber-number-number)([Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md), [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md), [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md))  | Copies elements within this array.                                                                                                                          |
| [entries](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#entries)()                                                                                                                                                                                                                                                                                      | Returns an iterator containing all index/value pairs of this array.                                                                                         |
| [every](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#everyfunction)([Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md))                                                                                                                                                                                            | Returns true if every element in this array satisfies the test  performed in the callback function.                                                         |
| [every](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#everyfunction-object)([Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md), [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))                                                                                                 | Returns true if every element in the thisObject argument satisfies the  test performed in the callback function, false otherwise.                           |
| [fill](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#fillobject-number-number)([Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md), [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md), [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md))              | Sets multiple entries of this array to specific value.                                                                                                      |
| [filter](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#filterfunction)([Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md))                                                                                                                                                                                          | Returns a new Array with all of the elements that pass the test  implemented by the callback function.                                                      |
| [filter](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#filterfunction-object)([Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md), [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))                                                                                               | Returns a new Array with all of the elements that pass the test  implemented by the callback function that is run against the  specified Array, thisObject. |
| [find](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#findfunction-object)([Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md), [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))                                                                                                   | Returns the first value within the array that satisfies the test  defined in the callback function.                                                         |
| [findIndex](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#findindexfunction-object)([Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md), [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))                                                                                         | Returns the index of the first value within the array that satisfies the test  defined in the callback function.                                            |
| [forEach](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#foreachfunction)([Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md))                                                                                                                                                                                        | Runs the provided callback function once for each element present in  the Array.                                                                            |
| [forEach](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#foreachfunction-object)([Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md), [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))                                                                                             | Runs the provided callback function once for each element present in  the specified Array, thisObject.                                                      |
| static [from](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#fromobject-function-object)([Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md), [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md), [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)) | Creates a new array from an array-like object or an [Iterable](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Iterable.md).                 |
| [includes](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#includesobject-number)([Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md), [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md))                                                                                                 | Returns if the array contains a specific value.                                                                                                             |
| [indexOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#indexofobject)([Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))                                                                                                                                                                                              | Returns the first index at which a given element can be found in the  array, or -1 if it is not present.                                                    |
| [indexOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#indexofobject-number)([Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md), [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md))                                                                                                   | Returns the first index at which a given element can be found in the  array starting at fromIndex, or -1 if it is not present.                              |
| static [isArray](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#isarrayobject)([Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))                                                                                                                                                                                       | Checks if the passed object is an array.                                                                                                                    |
| [join](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#join)()                                                                                                                                                                                                                                                                                            | Converts all Array elements to Strings and concatenates them.                                                                                               |
| [join](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#joinstring)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                                                                                                                                    | Converts all array elements to Strings and concatenates them.                                                                                               |
| [keys](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#keys)()                                                                                                                                                                                                                                                                                            | Returns an iterator containing all indexes of this array.                                                                                                   |
| [lastIndexOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#lastindexofobject)([Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))                                                                                                                                                                                      | Returns the last index at which a given element can be found in the  array, or -1 if it is not present.                                                     |
| [lastIndexOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#lastindexofobject-number)([Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md), [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md))                                                                                           | Returns the last index at which a given element can be found in the  array starting at fromIndex, or -1 if it is not present.                               |
| [map](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#mapfunction)([Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md))                                                                                                                                                                                                | Creates a new Array with the results of calling the specified function  on every element in this Array.                                                     |
| [map](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#mapfunction-object)([Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md), [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))                                                                                                     | Creates a new Array with the results of calling the specified function  on every element in the specified Array.                                            |
| static [of](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#ofobject)([Object...](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))                                                                                                                                                                                              | Creates a new array from a variable list of elements.                                                                                                       |
| [pop](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#pop)()                                                                                                                                                                                                                                                                                              | Removes and returns the last element of the Array.                                                                                                          |
| [push](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#pushobject)([Object...](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))                                                                                                                                                                                                 | Appends elements to the Array.                                                                                                                              |
| [reverse](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#reverse)()                                                                                                                                                                                                                                                                                      | Reverses the order of the elements in the Array.                                                                                                            |
| [shift](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#shift)()                                                                                                                                                                                                                                                                                          | Shifts elements down in the Array and returns the  former first element.                                                                                    |
| [slice](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#slicenumber-number)([Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md), [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md))                                                                                                       | Returns a new Array containing a portion of the  Array using the specified start and end positions.                                                         |
| [some](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#somefunction)([Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md))                                                                                                                                                                                              | Returns true if any of the elements in the Array pass the test  defined in the callback function, false otherwise.                                          |
| [some](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#somefunction-object)([Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md), [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))                                                                                                   | Returns true if any of the elements in the specified Array pass the test  defined in the callback function, false otherwise.                                |
| [sort](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#sort)()                                                                                                                                                                                                                                                                                            | Sorts the elements of the Array in alphabetical order based on character encoding.                                                                          |
| [sort](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#sortfunction)([Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md))                                                                                                                                                                                              | Sorts the elements of the Array in alphabetical  order based on character encoding.                                                                         |
| [splice](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#splicenumber-number-object)([Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md), [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md), [Object...](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))       | Deletes the specified number of elements from the Array at the specified position,  and then inserts values into the Array at that location.                |
| [toLocaleString](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#tolocalestring)()                                                                                                                                                                                                                                                                        | Converts the Array to a localized String.                                                                                                                   |
| [toString](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#tostring)()                                                                                                                                                                                                                                                                                    | Converts the Array to a String.                                                                                                                             |
| [unshift](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#unshiftobject)([Object...](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))                                                                                                                                                                                           | Inserts elements at the beginning of the Array.                                                                                                             |
| [values](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md#values)()                                                                                                                                                                                                                                                                                        | Returns an iterator containing all values of this array.                                                                                                    |

### Methods inherited from class Object

[assign](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#assignobject-object), [create](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#createobject), [create](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#createobject-object), [defineProperties](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#definepropertiesobject-object), [defineProperty](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#definepropertyobject-object-object), [entries](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#entriesobject), [freeze](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#freezeobject), [fromEntries](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#hasownpropertystring), [is](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isobject-object), [isExtensible](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isextensibleobject), [isFrozen](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isfrozenobject), [isPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isprototypeofobject), [isSealed](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#issealedobject), [keys](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#keysobject), [preventExtensions](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#propertyisenumerablestring), [seal](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#sealobject), [setPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#tolocalestring), [toString](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#tostring), [valueOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#valueof), [values](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#valuesobject)

## Property Details

### length

- length: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)
  - : The length of the Array.

***

## Constructor Details

### Array()

- Array()
  - : Constructs an Array.

***

### Array(Number)

- Array(length: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md))
  - : Constructs an Array of the specified
    length.

    **Parameters:**

    - length - the length of the Array.

***

### Array(Object...)

- Array(values: [Object...](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md))
  - : Constructs an Array using the specified values.

    **Parameters:**

    - values - zero or more values that are stored in the Array.

***

## Method Details

### concat(Object...)

- concat(values: [Object...](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): [Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md)
  - : Constructs an Array by concatenating multiple values.

    **Parameters:**

    - values - one or more Array values.

    **Returns:**

    - a new Array containing the concatenated values.

***

### copyWithin(Number, Number, Number)

- copyWithin(target: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md), start: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md), end: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)): [Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md)
  - : Copies elements within this array. The array length is not changed.

    **Parameters:**

    - target - The target of the first element to copy.
    - start - Optional. The first index to copy. Default is 0.
    - end - Optional. The index of the end. This element is not included. Default is copy all to the array end.

    **Returns:**

    - This array.

    **API Version:**

:::note
Available from version 21.2.
:::

***

### entries()

- entries(): [ES6Iterator](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.ES6Iterator.md)
  - : Returns an iterator containing all index/value pairs of this array.
    The iterator produces a series of two-element arrays with the first element as the index and the second element as the value.

    **API Version:**

:::note
Available from version 21.2.
:::

***

### every(Function)

- every(callback: [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md)): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : Returns true if every element in this array satisfies the test
    performed in the callback function.  The callback function is
    invoked with three arguments: the value of the element,
    the index of the element, and the Array object being traversed.

    **Parameters:**

    - callback - the function to call to determine if every element  in this array satisfies the test defined by the function.  The callback function is  invoked with three arguments: the value of the element,  the index of the element, and the Array object being traversed.

    **Returns:**

    - true if every element in this array satisfies the test
      performed in the callback function.

    **See Also:**

    - [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md)

***

### every(Function, Object)

- every(callback: [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md), thisObject: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : Returns true if every element in the thisObject argument satisfies the
    test performed in the callback function, false otherwise.
    The callback function is invoked with three arguments: the value of the
    element, the index of the element, and the Array object being traversed.

    **Parameters:**

    - callback - the function to call to determine if every element  in this array satisfies the test defined by the function. The callback  function is invoked with three arguments: the value of the element,  the index of the element, and the Array object being traversed.
    - thisObject - the Object to use as 'this' when executing callback.

    **Returns:**

    - true if every element in thisObject satisfies the test
      performed in the callback function, false otherwise.

    **See Also:**

    - [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md)

***

### fill(Object, Number, Number)

- fill(value: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md), start: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md), end: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)): [Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md)
  - : Sets multiple entries of this array to specific value.

    **Parameters:**

    - value - The value to set.
    - start - Optional. The first index to copy. Default is 0.
    - end - Optional. The index of the end. This element is not included. Default is copy all to the array end.

    **Returns:**

    - This array.

    **API Version:**

:::note
Available from version 21.2.
:::

***

### filter(Function)

- filter(callback: [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md)): [Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md)
  - : Returns a new Array with all of the elements that pass the test
    implemented by the callback function. The callback function is
    invoked with three arguments: the value of the element,
    the index of the element, and the Array object being traversed.

    **Parameters:**

    - callback - the function that is called on this Array and  which returns a new Array containing the elements that satisfy the  function's test. The callback function is  invoked with three arguments: the value of the element,  the index of the element, and the Array object being traversed.

    **Returns:**

    - a new Array containing the elements that satisfy the
      function's test.

***

### filter(Function, Object)

- filter(callback: [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md), thisObject: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): [Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md)
  - : Returns a new Array with all of the elements that pass the test
    implemented by the callback function that is run against the
    specified Array, thisObject. The callback function is
    invoked with three arguments: the value of the element,
    the index of the element, and the Array object being traversed.

    **Parameters:**

    - callback - the function that is called on the thisObject Array and  which returns a new Array containing the elements that satisfy the  function's test. The callback function is  invoked with three arguments: the value of the element,  the index of the element, and the Array object being traversed.
    - thisObject - the Object to use as 'this' when executing callback.

    **Returns:**

    - a new Array containing the elements that satisfy the
      function's test.

***

### find(Function, Object)

- find(callback: [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md), thisObject: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - : Returns the first value within the array that satisfies the test
    defined in the callback function.

    **Parameters:**

    - callback - The function to call, which is invoked with three  arguments: the value of the element, the index of the element, and the  Array object being traversed.
    - thisObject - The object to use as 'this' when executing callback.

    **Returns:**

    - The first value within the array that satisfies the test
      defined in the callback function, `undefined` if no matching value was found.

    **API Version:**

:::note
Available from version 21.2.
:::

***

### findIndex(Function, Object)

- findIndex(callback: [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md), thisObject: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)
  - : Returns the index of the first value within the array that satisfies the test
    defined in the callback function.

    **Parameters:**

    - callback - The function to call, which is invoked with three  arguments: the value of the element, the index of the element, and the  Array object being traversed.
    - thisObject - The object to use as 'this' when executing callback.

    **Returns:**

    - The index of the first value within the array that satisfies the test
      defined in the callback function, `-1` if no matching value was found.

    **API Version:**

:::note
Available from version 21.2.
:::

***

### forEach(Function)

- forEach(callback: [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md)): void
  - : Runs the provided callback function once for each element present in
    the Array. The callback function is invoked only for indexes of the
    Array which have assigned values; it is not invoked for indexes which
    have been deleted or which have never been assigned a value.

    **Parameters:**

    - callback - the function to call, which is invoked with three  arguments: the value of the element, the index of the element, and the  Array object being traversed.

***

### forEach(Function, Object)

- forEach(callback: [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md), thisObject: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): void
  - : Runs the provided callback function once for each element present in
    the specified Array, thisObject. The callback function is invoked only
    for indexes of the Array which have assigned values; it is not invoked
    for indexes which have been deleted or which have never been assigned
    a value.

    **Parameters:**

    - callback - the function to call, which is invoked with three  arguments: the value of the element, the index of the element, and the  Array object being traversed.
    - thisObject - the Object to use as 'this' when executing callback.

***

### from(Object, Function, Object)

- static from(arrayLike: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md), mapFn: [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md), thisObject: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): [Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md)
  - : Creates a new array from an array-like object or an [Iterable](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Iterable.md).

    **Parameters:**

    - arrayLike - An array-like object or an iterable that provides the elements for the new array.
    - mapFn - Optional. A function that maps the input elements into the value for the new array.
    - thisObject - Optional. The Object to use as 'this' when executing mapFn.

    **Returns:**

    - The newly created array.

    **API Version:**

:::note
Available from version 21.2.
:::

***

### includes(Object, Number)

- includes(valueToFind: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md), fromIndex: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : Returns if the array contains a specific value.

    **Parameters:**

    - valueToFind - The value to look for.
    - fromIndex - Optional. The index to start from.

    **Returns:**

    - `true` if the value is found in the array else `false`.

    **API Version:**

:::note
Available from version 21.2.
:::

***

### indexOf(Object)

- indexOf(elementToLocate: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)
  - : Returns the first index at which a given element can be found in the
    array, or -1 if it is not present.

    **Parameters:**

    - elementToLocate - the element to locate in the Array.

    **Returns:**

    - the index of the element or -1 if it is no preset.

***

### indexOf(Object, Number)

- indexOf(elementToLocate: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md), fromIndex: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)): [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)
  - : Returns the first index at which a given element can be found in the
    array starting at fromIndex, or -1 if it is not present.

    **Parameters:**

    - elementToLocate - the element to locate in the Array.
    - fromIndex - the index from which to start looking for the element.

    **Returns:**

    - the index of the element or -1 if it is no preset.

***

### isArray(Object)

- static isArray(object: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : Checks if the passed object is an array.

    **Parameters:**

    - object - The object to ckeck.

    **Returns:**

    - `true` if the passed object is an array else `false`.

***

### join()

- join(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Converts all Array elements to Strings and concatenates them.

    **Returns:**

    - a concatenated list of all Array elements as a String.

***

### join(String)

- join(separator: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Converts all array elements to Strings and concatenates them.

    **Parameters:**

    - separator - an optional character or string used to separate one element  of the Array from the next element in the return String.

    **Returns:**

    - a concatenated list of all Array elements as a String where the
      specified delimiter is used to separate elements.

***

### keys()

- keys(): [ES6Iterator](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.ES6Iterator.md)
  - : Returns an iterator containing all indexes of this array.

    **API Version:**

:::note
Available from version 21.2.
:::

***

### lastIndexOf(Object)

- lastIndexOf(elementToLocate: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)
  - : 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.

    **Parameters:**

    - elementToLocate - the element to locate in the Array.

    **Returns:**

    - the index of the element or -1 if it is no preset.

***

### lastIndexOf(Object, Number)

- lastIndexOf(elementToLocate: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md), fromIndex: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)): [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)
  - : Returns the last index at which a given element can be found in the
    array starting at fromIndex, or -1 if it is not present.
    The array is searched backwards.

    **Parameters:**

    - elementToLocate - the element to locate in the Array.
    - fromIndex - the index from which to start looking for the element.  The array is searched backwards.

    **Returns:**

    - the index of the element or -1 if it is no present.

***

### map(Function)

- map(callback: [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md)): [Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md)
  - : Creates a new Array with the results of calling the specified function
    on every element in this Array. The callback function is invoked only
    for indexes of the Array which have assigned values; it is not invoked
    for indexes which have been deleted or which have never been assigned
    values.

    **Parameters:**

    - callback - the function to call, which is invoked with three  arguments: the value of the element, the index of the element, and the  Array object being traversed.

    **Returns:**

    - a new Array with the results of calling the specified function
      on every element in this Array.

***

### map(Function, Object)

- map(callback: [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md), thisObject: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): [Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md)
  - : Creates a new Array with the results of calling the specified function
    on every element in the specified Array. The callback function is invoked only
    for indexes of the Array which have assigned values; it is not invoked
    for indexes which have been deleted or which have never been assigned
    values.

    **Parameters:**

    - callback - the function to call, which is invoked with three  arguments: the value of the element, the index of the element, and the  Array object being traversed.
    - thisObject - the Object to use as 'this' when executing callback.

    **Returns:**

    - a new Array with the results of calling the specified function
      on every element in this Array.

***

### of(Object...)

- static of(values: [Object...](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): [Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md)
  - : Creates a new array from a variable list of elements.

    **Parameters:**

    - values - The array values.

    **Returns:**

    - The newly created array.

    **API Version:**

:::note
Available from version 21.2.
:::

***

### pop()

- pop(): [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - : Removes and returns the last element of the Array.

    **Returns:**

    - the last element of the Array.

***

### push(Object...)

- push(values: [Object...](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)
  - : Appends elements to the Array.

    **Parameters:**

    - values - one or more values that will be appended to the Array.

    **Returns:**

    - the new length of the Array.

***

### reverse()

- reverse(): void
  - : Reverses the order of the elements in the Array.

***

### shift()

- shift(): [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - : Shifts elements down in the Array and returns the
    former first element.

    **Returns:**

    - the former first element.

***

### slice(Number, Number)

- slice(start: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md), end: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)): [Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md)
  - : Returns a new Array containing a portion of the
    Array using the specified start and end positions.

    **Parameters:**

    - start - the location in the Array to start the slice  operation.
    - end - the location in the Array to stop the slice  operation.

    **Returns:**

    - a new Array containing the members bound by
      start and end.

***

### some(Function)

- some(callback: [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md)): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : Returns true if any of the elements in the Array pass the test
    defined in the callback function, false otherwise.

    **Parameters:**

    - callback - the function to call, which is invoked with three  arguments: the value of the element, the index of the element, and the  Array object being traversed.

    **Returns:**

    - true if any of the elements in the Array pass the test
      defined in the callback function, false otherwise.

***

### some(Function, Object)

- some(callback: [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md), thisObject: [Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): [Boolean](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Boolean.md)
  - : Returns true if any of the elements in the specified Array pass the test
    defined in the callback function, false otherwise.

    **Parameters:**

    - callback - the function to call, which is invoked with three  arguments: the value of the element, the index of the element, and the  Array object being traversed.
    - thisObject - the Object to use as 'this' when executing callback.

    **Returns:**

    - true if any of the elements in the Array pass the test
      defined in the callback function, false otherwise.

***

### sort()

- sort(): [Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md)
  - : Sorts the elements of the Array in alphabetical order based on character encoding.

    This sort is guaranteed to be *stable*: equal elements will not be reordered as a result of the sort.

    **Returns:**

    - a reference to the Array.

***

### sort(Function)

- sort(function: [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md)): [Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md)
  - : Sorts the elements of the Array in alphabetical
    order based on character encoding.

    This sort is guaranteed to be *stable*: equal elements will not be reordered as a result of the sort.

    **Parameters:**

    - function - a Function used to specify the sorting  order.

    **Returns:**

    - a reference to the Array.

    **See Also:**

    - [Function](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Function.md)

***

### splice(Number, Number, Object...)

- splice(start: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md), deleteCount: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md), values: [Object...](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): [Array](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Array.md)
  - : Deletes the specified number of elements from the Array at the specified position,
    and then inserts values into the Array at that location.

    **Parameters:**

    - start - the start location.
    - deleteCount - the number of items to delete.
    - values - zero or more values to be inserted into the Array.

***

### toLocaleString()

- toLocaleString(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Converts the Array to a localized String.

    **Returns:**

    - a localized String representing the Array.

***

### toString()

- toString(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Converts the Array to a String.

    **Returns:**

    - a String representation of the Array.

***

### unshift(Object...)

- unshift(values: [Object...](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)): [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)
  - : Inserts elements at the beginning of the Array.

    **Parameters:**

    - values - one or more vales that will be inserted  into the beginning of the Array.

    **Returns:**

    - the new length of the Array.

***

### values()

- values(): [ES6Iterator](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.ES6Iterator.md)
  - : Returns an iterator containing all values of this array.

    **API Version:**

:::note
Available from version 21.2.
:::

***
