The difference between `any` and `unknown` in #TypeScript: any = “I don’t...
The difference between `any` and `unknown` in #TypeScript:
any = “I don’t care”
unknown = “I don’t know”
Prefer `unknown` over `any`. Why? Because `unknown` requires narrowing the type before it can be used.
any ignores types. 👎
unknown requires type narrowing before use. 👍

TS Playground of the example above: https://www.typescriptlang.org/play?#code/PTAEDkHsBcFNWgCwIbQYglgZ1NhBPAB1gBNRkcBXAOwGtrIB3agOgCgBjSarNSrWACcAXKBr0m1UAF5QAbzahcJUQEYANItDVkAW1iiARAGFIg-IbYBfNm2hF4AVQGCZ8rRhXbKugEZCAbi0dfVFeQQxqAHMgmzYQUAAVTBwAG0j4Rm4AcjQswVpQfw5kfngAAzLBctwce2IyCjE6BmZyX0gAN1gWUABZfjQdQUEmdHh6+H8AMzN4AElQEqky3Gh2BK4eSFSe1MgogAoqlk8ASiD4sHBkEaZIqKLYWcEFpeQpEtTUsRdTknYGGmoEO2GcQmOLjOZ3cSi2WB2ewOkKE-wu1ls0xoHGgGG4tXBgkOtyiog++DOZMEjzwhNhoFe0Eogikh0mkGBJJk0lkhkgvgAVrAcYYYQAyMUgrkAQh53m+4rFWiUh0MnkMuCkJMVIPZnOp-25vOoPn8glFsSAA
(this Playground also fixes a typo in the screenshot above - the last line should be typeof http://arg.id === "number")
One other fix: The code example in the initial tweet omitted checking for the name property. Here's a TS playground that correctly checks for the id and name properties.
https://www.typescriptlang.org/play?#code/PTAEDkHsBcFNWgCwIbQYglgZ1NhBPAB1gBNRkcBXAOwGtrIB3agOgCgBjSarNSrWACcAXKBr0m1UAF5QAbzahcJUQEYANItDVkAW1iiARAGFIg-IbYBfNm2hF4AVQGCZ8rRhXbKugEZCAbi0dfVFeQQxqAHMgmzYQUAAVTBwAG0j4Rm4AcjQswVpQfw5kfngAAzLBctwce2IyCjE6BmZyX0gAN1gWUABZfjQdQUEmdHh6+H8AMzN4AElQEqky3Gh2BK4eSFSe1MgogAoqlk8ASiD4sHBkEaZIqKLYWcEFpeQpEtTUsRdTknYGGmoEO2GcQmOLjOZ3cSi2WB2ewOkKE-wu1ls0xoHGgGG4tXBgkOtyiog++DOZMEjzwhNhoFe0Eogikh0mkGBJJk0lkhkgvgAVrAcYYYQAyMUgrkAQh53m+4rFWiUh0MnkMuCkJMVIPZnOp-25vOoPn8glFoAluocHPIBpC8B5vPCD1FsSAA