Reputation: 5
How to check if a number is greater than another number in some quantity in JS?
Upvotes: 0
Views: 1349
Reputation: 313
Use addition or Subtraction for this,
Example : let a = 20; let b = 30;
if((a + 10) > b ){
console.log(' a + 10 is not equal to b');
}
or
if(a > ( b - 10) ){
console.log(' a is not equal to b - 10');
}
Upvotes: 1