指定步长中间值

var a = function(num1, num2, length, ratio) {
        var max = Math.max(num1, num2), min = Math.min(num1, num2), list = [max], range = max - min, i;
        list[r] = min;
        for (i = 1; i < length; i++) {
            list[i] = (range = range / ratio) + min
        }
        return num1 > num2 ? list : list.reverse()
    };

 

你可能感兴趣的:(值)