DEV Community

Arul .A
Arul .A

Posted on

Typecasting?

⦁ It means changing one data type to another data type.
EX: string to number, number to string.
⦁ It has two types. These are

  1. Implicit typecasting - JS automatically changes Ex: "5" + 2 → "52" (number → string)
  2. Explicit typecasting - manually change Ex: Number("5") → 5 (string → number)

Top comments (0)