📅  最后修改于: 2022-03-11 15:03:23.408000             🧑  作者: Mango
let arr = [1,2,4,5,6];
let differenceAry = arr.slice(1).map(function(n, i) { return n - arr[i]; })
let isDifference= differenceAry.every(value => value == 1)
console.log(isDifference);