TypeScript vs Unknown Type Safety

TypeScript (any v/s unknown) 🙂 ======== any -> turn off type and without any type its runs normally.Type safety zero, accept anything unknown -> Unknown have type narrowing means you don't know the type on that time but you can use its later. example -> if you dont know what api response come from backend side. so , use it unknown, after api response come from backend side. so you aware of that type response that time you using type that means forcing narrowing type which means you exactly known what type come. any means anything come just accept it. #TypeScript #JavaScript #FrontendDevelopment #WebDevelopment #SoftwareEngineering #CleanCode #TechCareers #Programming #Developers #ReactJS #CodingLife

To view or add a comment, sign in

Explore content categories