array.first()

Returns the first item from an array. Throws an error if the array is empty.

array.first( )

Returns: any

This function does not take any arguments.

Examples

myarray = ["one","two","three","TWO","five","Two"];
	res = myarray.first();
	writedump(res);
	myarray = [{"one":1},"two","three","TWO","five","Two"];
	res = myarray.first();
	writedump(res);

See also