Avoid the non-primitive
Symbol types in TypeScript.
All of them refer to non-primitive reference types.
Instead, prefer the corresponding primitive types.
let textToCheck: String = 'text'; console.log(typeof textToCheck); // 'string' console.log(textToCheck === 'text'); // true textToCheck = new String('text'); console.log(typeof textToCheck); // 'object' console.log(textToCheck === 'text'); // false
It's easy to failed your equality check with them.
That's it, make good use of it !
I'm not a native English speaker so, thanks in advance if you want to improve my article with correct syntax/grammar/sentences.
I can accept all kind remarks :)