ArrayDeleteAt

Delete item at specified index in array

Method Signature

ArrayDeleteAt(array=[modifiableArray], index=[integer])

Arguments

Argument
Type
Required
Description
Default

array

modifiableArray

true

The array to be deleted from.

index

integer

true

The index to deleted.

Examples

Simple example for arrayDeleteAt function

Uses the arrayDeleteAt function to delete the value in specific position

Run Example

someArray = [ 
	"Red",
	"White",
	"Green",
	"Blue",
	"Pink"
];
arrayDeleteAt( someArray, 3 );
writeOutput( JSONSerialize( someArray ) );

Result: ["Red", "White", "Blue", "Pink"]

Simple example with member function

Uses the member function is the same as running arrayDeleteAt.

Run Example

someArray = [ 
	"Red",
	"White",
	"Green",
	"Blue",
	"Pink"
];
someArray.DeleteAt( 2 );
writeOutput( JSONSerialize( someArray ) );

Result: ["Red", "Green", "Blue", "Pink"]

Additional Examples

Run Example

arr = [ 
	12,
	0,
	1,
	2,
	3,
	4,
	5,
	6
];
dump( arr );
arrayDeleteAt( arr, 4 );
dump( arr );

Run Example

arr = [ 
	12,
	0,
	1,
	2,
	3,
	4,
	5,
	6
];
dump( arr );
arr.deleteAt( 4 );
dump( arr );

Last updated

Was this helpful?