Skip to content

Commit

Permalink
Commit Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
neeru24 committed Sep 8, 2024
1 parent f7736e0 commit 014e677
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Javascript/comparison.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
console.log("Simple comparisons ");

console.log(2 > 1);
console.log(2 >= 1);
console.log(2 < 1);
console.log(2 == 1);
console.log(2 != 1);

// Different datatypes

console.log("Different Datatypes ");
console.log("2" > 1);
console.log("02" > 1);

// Null

console.log("Null : ");
console.log(null > 0);
console.log(null == 0);
console.log(null >= 0);

// Undefined

console.log("Undefined: ");
console.log(undefined == 0);
console.log(undefined > 0);
console.log(undefined < 0);

// === Strict Equality

console.log("Strict Check");
console.log("2" === 2);

0 comments on commit 014e677

Please sign in to comment.