次の質問以外に、この質問をする最善の方法がわかりません。
「x」という変数を受け入れる関数を書いています。
function doIt(x){
var y = someformula; //this is just a placeholder for the correct formula
return y;
}
そして、これが私が期待するものです:
if (x is between 0 and 9){ y = 0; }
if (x is between 10 and 19){ y = 32; }
if (x is between 20 and 29){ y = 64; }
if (x is between 30 and 39){ y = 96; }
等々....
どんな助けでも大歓迎です。
問題がある場合は、JavaScriptで実行しています。