JavaScript 循环生成负数数组:每隔 20 个元素
var negativeNumbers = [];
for(var i=0; i>=-length; i-=20){ negativeNumbers.push(i); }
console.log(negativeNumbers); // 输出 [-20, -40, -60, -80, -100, -120, -140, -160, -180, -200]
原文地址: https://www.cveoy.top/t/topic/ovsD 著作权归作者所有。请勿转载和采集!