Strict equality uses === to compare both value and type without coercion. Unlike ==, it does not convert operands before deciding whether they match. section 3.4.7
Number versus string
let firstVal: any = 5; let secondVal: any = "5"; if (firstVal === secondVal) { console.log("They are the same"); } else { console.log("They are NOT the same"); } // They are NOT the same
Use === when a comparison must reject values whose types differ. TypeScript can also flag comparisons between inferred number and string types as always false.



