Skip to end of banner
Go to start of banner

arrayDeleteElementAt

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Availability

This routine is available since katl-commons 1.0 .

 

Description:

If index is less than the array size, returns a new array without the element at the specified index.

Alias:

deleteElementAt(array, index)

Parameters:

Parameter name

Type

Required

Description

array

array

Yes

The array from which the element at the specified index is deleted.

index

number

Yes

The index of the element to be deleted.

Return Type:

array

Example:

Example 1:

if(size(watchers) >= 2){
	watchers2 = deleteElementAt(watchers, 1);
} 

The result returned by the routine is assigned to a new array watchers2, so the initial array watchers will not be modified.

Example 2:

if(size(watchers) >= 2){
	watchers = deleteElementAt(watchers, 1);
}

The result returned by the routine is assigned to the the same array watchers, so the initial array watchers will be modified.

See Also:

 

  • No labels