TypeScript | Introduction to TypeScript | Question2

Last Updated :
Discuss
Comments

How do you explicitly declare a variable with a type in TypeScript?

let name = "Alice"

let name: string = "Alice"

let string name = "Alice"

string name = "Alice"

Share your thoughts in the comments