The Multiple Methods of Declaring a String

In this lesson, you will look at how to initialize a string in a single line, as well as how to write a string on multiple lines.

Strings on a single line

The first primitive is the string. A string is made of characters. It can be assigned a single quote or a double quote. A string’s content can be a number but will behave as characters if between quotes. Both single and double quotes are accepted. However, the guideline of the TypeScript project uses a double quote. By the way, TypeScript is written in TypeScript! It means the language itself is written with the language, hence following its guidance is a good idea.

Get hands-on with 1200+ tech skills courses.