--

I frequently find myself needing String(), Number(), and Boolean() in JavaScript. In TypeScript, the as keyword is great for coercing a known data type following data fetching. I do try to avoid the built-in coercion ("string" + 3) in JavaScript.

--

--

Dr. Derek Austin 🥳
Dr. Derek Austin 🥳

Written by Dr. Derek Austin 🥳

Hi, I'm Doctor Derek! I've been a professional web developer since 2005, and I love writing about programming with JavaScript, TypeScript, React, Next.js & Git.

Responses (1)