/**
* 快速生成想要的位数数组,并给定基准值,以基准值的前后范围生成数组
*
* digit: 所要生成的数组位数
* baseValue: 基准值
*/
const arr = (digit, baseValue) => {
return Array.from(Array(digit), (value, index)=> {
return baseValue + index - (digit / 2)
})
}
console.log(arr(10, 10))