diff --git a/Javascript/comparison.js b/Javascript/comparison.js new file mode 100644 index 0000000..73fcd71 --- /dev/null +++ b/Javascript/comparison.js @@ -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); \ No newline at end of file