I have the following array
A=[1,2,3,3,0]
and if I want to calculate difference between consecutive numbers in an array. I could do it in Matlab with using built-in function (diff)
B=diff(A) returns
B = [1,1,0,-3]
I would like to know there is any similar built-in function in javascript?