I would like to know how can I obtain the last two elements of this array like this:
array = [1,5,7,8,10,12,23,24];
I am trying to obtain with slice() function
but it doesn´t work for me, beacuse I always I want to obtain the last two positions.
array = [23,24];
I hope that anyone can help me in this question.
Regards!