Copy link to clipboard
Copied
I'm stuck in a program where I nee the last value of an array.
Can Someone please tell me how to retrieve the last value of an array please?
Many thanks in advance
Dulan
Copy link to clipboard
Copied
hi,
you can use lastElementF():
function lastElementF(a:Array):*{
return a[a.length-1];
}
p.s. if you also want to remove the last element, use the pop() method of arrays.
Copy link to clipboard
Copied
Thank you very much for your help.
Copy link to clipboard
Copied
you're welcome.