如何检查一个数字是否大于另一个数字,一定数量?

时间:2017-04-12 19:24:28

标签: javascript

我将如何制作以下if语句?

var a = 50;
var b = 10;

if(a > b by 20){
    console.log("a is too big");
}

2 个答案:

答案 0 :(得分:4)

if(a - b > 20) {
  console.log('You didnt try much it seems')

}

答案 1 :(得分:0)

你为什么不这样做:

if (a > (b + 20)) {
  console.log("a is too big");
}