Wednesday, September 29, 2021

JavaScript- Relational Operators- Boolean

Following code fragement will be help you understand the relational operators resulting in boolean values.

var a = 10;
console.log(a == 0); // false
console.log(a == 10); // true

console.log(a != 10); // false
console.log(a != 5); // true

console.log(a > 5); // true
console.log(a > 10); // false
console.log(a > 15); // false
console.log(a >= 10); // true

console.log(a < 5); // false
console.log(a < 10); // false
console.log(a < 15); // true
console.log(a <= 10); // true

No comments:

Post a Comment