Identifiers simply describe the names we use when referring to instances like variables, functions, etc., that are declared in a program.
Every programming language has specific rules and regulations to follow when declaring identifiers, and TypeScript is no exception.
Identifiers are case sensitive. For example,
_varname is not the same as
Only symbols like
_ can be placed at the beginning of an identifier.
Identifiers can’t start with numbers, only letters.
Identifiers can’t have the same name as keywords.
Spaces cannot be included in an identifier.
spaces not allowed
'@' not allowed
can't start with a digit
'-' not allowed , only '_' or '$'
return is a reserved keyword
Keywords are reserved words in a programming language that have special meaning and perform a specific function in a program.
There are reserved in the sense that they can only be used for a purpose specified by the programming language, and they can’t be used as identifiers for variables, functions, etc.
When keywords are mistakenly used for purposes they are not intended for, compile errors are generated.
View all Courses