last ()
last
<
T
,
R
>
(
x
)
:
R
Returns the last element of an array or last character of a string.
Type Parameters
T
R
=
T
extends
readonly
A
[]
?
OptSafe
<
A
>
:
Opt
<
string
>
Parameters
x
:
EmptyValue
|
T
Returns
R
Back to index
Returns the last element of an array or last character of a string.