function用法


function用法

文章插图
function setValue(m) {var incomeRate = {free: 3500,levels: [{low: 0,high: 1500,rate: 0.03,sub: 0}, {low: 1500,high: 4500,rate: 0.1,sub: 105}, {low: 4500,high: 9000,rate: 0.2,sub: 555}, {low: 9000,high: 35000,rate: 0.25,sub: 1005}, {low: 35000,high: 55000,rate: 0.3,sub: 2755}, {low: 55000,high: 80000,rate: 0.35,sub: 5505}, {low: 80000,high: 99999999999999,rate: 0.45,sub: 13505}]};var other = m - incomeRate.free;for (var i = 0; i < incomeRate.levels.length; i++) {if (incomeRate.levels[i].high >= other) {return incomeRate.levels[i];}}}
【function用法】

    推荐阅读