Improving or replacing a long if statement
If I were doing this, I'd start by putting the data into a 2 dimensional array. As raw data, it seems to be pretty much this:




default
12
24
36
48
60




36
-0.2
-0.1
0.0
0.15
0.3


48
-0.1
0.0
0.1
0.25
0.4


60
0.0
0.1
0.2
0.35
0.5




I don't do a lot of JavaScript, but I think in JavaScript syntax, that works out to something on this general order:
var priceTable = { 
    &quot;36&quot;: { &quot;12&quot;: -0.2, &quot;24&quot;: -0.1, &quot;36&quot;: 0.0, &quot;48&quot;: 0.15, &quot;60&quot;: 0.3 }, 
    &quot;48&quot;: { &quot;12&quot;: -0.1, &quot;24&quot;:  0.0, &quot;36&quot;: 0.1, &quot;48&quot;: 0.25, &quot;60&quot;: 0.4 }, 
    &quot;60&quot;: { &quot;12&quot;:  0.0, &quot;24&quot;:  0.1, &quot;36&quot;: 0.2, &quot;48&quot;: 0.35, &quot;60&quot;: 0.5 } 
};

this.price += priceTable[defaultMonth][month];