TypeScript is very popular because it adds static typing to JavaScript. This makes the code safer and better quality, which JavaScript developers l...
For further actions, you may consider blocking this person and/or reporting abuse
In simpler terms,
any lets you do anything you want
unknown doesn't let you do anything at all without checking the type first.
let vAny: any = 10; // We can assign anything to any
let vUnknown: unknown = 10; // We can assign anything to unknown just like any
let s1: string = vAny; // Any is assignable to anything
let s2: string = vUnknown; // Invalid; we can't assign vUnknown to any other type (without an explicit assertion)
Thanks for sharing this insight. 👌 It’s really helpful.
Thanks for reading and glad you find it helpful.
GOOD STOTY
GOOD STOTY
Thanks for sharing this. Any is especially bad because if the conditions change, you won’t get any warning
Exactly, thanks for reading.
Really helpful insight. 👍
Glad you find it helpful.
Hi Sachin Chaurasiya,
Your tips are very useful
Thanks for sharing
Glad you find it useful.