firstNum = numbers[0]; lastNum = numbers[numbers.length-1];

Read more of this post