- 1 == 1;
- 1 == ‘1’;
- 1 == “1”;
As a little bonus snippet in a post by Steve Wellens he provides an answer to the problem, the triple equals (“===”) and it’s corresponding, not equal (“!==”). These comparison operators perform a type check as well as a value check. This means that a string value will no longer equal it’s corresponding numeric value as the type check will return false. A useful bit of functionality to have.
Just a note about TypeScript Playground, an online REPL for TypeScript. Been around a while, but really useful for trying out a quick bit of TypeScript.