const value1 = true;
const value2 = false;
console.log(value1);
console.log(value2);
Output
true
false
const value1 = true;
const value2 = false;
console.log(value1);
console.log(value2);
console.log(typeof(value1));
console.log(typeof(value2));
Output
true
false
boolean
boolean
const value1 = "true";
const value2 = "false";
console.log(value1);
console.log(value2);
console.log(typeof(value1));
console.log(typeof(value2));
Output
true
false
string
string
const value1 = True;
const value2 = False;
console.log(value1);
console.log(value2);
Output
ReferenceError: Can't find variable: True
console.log(8 > 5);
Output
true
console.log(3 < 5);
Output
true
console.log(5 >= 5);
Output
true
console.log(5 == 5);
Output
true
console.log(5 != 5);
Output
false
console.log("5" === 5);
Output
false
const number1 = 5;
const number2 = 9;
const result = number1 < number2;
console.log(result);
Output
true
const age = 18;
const height = 5.5;
let result = age >= 18 && height > 5;
console.log(result);
Output
true
let age = 18;
let height = 5.5;
let result = age >= 18 || height < 5;
console.log(result);
Output
true
const height = 5.5;
const result = height < 6;
console.log(!result);
Output
false
Q. Which of the following code returns true?
- 5 == -5
- 5 == '5'
- 5 === '5'
- 5 === -5
Answer: 2