last

Summary

Returns the last element of the array.

Signatures

Click on a signature to select it and view its documentation.

Usage

public T+ last()

Returns

The last element of the array or undefined if the array contains no elements.

Description

Returns the last element of the array. If there are no elements in the array, undefined will be returned.

This method does not mutate the array.

Examples

Basic Usage
1
2
3
4
import System;
 
int[] arr = [ 3, 4, 5 ];
Console.log(arr.last()); // 5

Share

HTML | BBCode | Direct Link