console.log(Last([7,9,0,-2]));
console.log(Last('d',3));
console.log(Last([1,3,4]));
console.log(Last([7, 9, 0, -2]));
console.log(Last([3,7, 9, 0, -1]));
console.log(Last([7, 9, 0, -4]));
function Last(Arr)
{
var last = Arr.slice(-1);
return last;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: