0
How to Return Last value of an Array?
Community Beginner
,
/t5/animate-discussions/how-to-return-last-value-of-an-array/td-p/9542207
Nov 10, 2017
Nov 10, 2017
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
TOPICS
ActionScript
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/animate-discussions/how-to-return-last-value-of-an-array/m-p/9542208#M174872
Nov 10, 2017
Nov 10, 2017
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.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Dulan1207
AUTHOR
Community Beginner
,
/t5/animate-discussions/how-to-return-last-value-of-an-array/m-p/9542209#M174873
Nov 10, 2017
Nov 10, 2017
Copy link to clipboard
Copied
Thank you very much for your help.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/animate-discussions/how-to-return-last-value-of-an-array/m-p/9542210#M174874
Nov 10, 2017
Nov 10, 2017
Copy link to clipboard
Copied
you're welcome.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

