|need help with this it keeps coming back as NaN, im trying to find the difference between 2 numbers in the array i,e, array[1,2,3,4,5,6]|
im trying to find difference with 1-2,2-3,3-4,4-5,5-6,6-1 can anybody help here is the code that ive put together so far but i think i messed up.
firstNumber = numberArray;
secondNumber = numberArray;
return firstNumber[numberArray.length] - secondNumber[numberArray.lemght];
var numberArray = [1,2,3,4,5,6];
document.write(numberArray + '
' +difference() +'