Open In App

Identifiers and Keywords in TypeScript

Identifiers: Identifiers are nothing but the names which is given to the members of any class like a variable, method name, class name, array name etc. Certain rules to be followed while declaring Identifiers:

Examples of Valid and Invalid Identifiers:



Valid Invalid
geeksforgeeks 1$geeksforgeeks
geeks_for_geeks #geeks
$geeks geeks-for-geeks
_geeks$ any

Keywords: Keywords are words which are responsible to perform some specific task or the words which represent some specific functionality. The following table lists some keywords:

break as any switch case if
throw else var number string get
module type instanceof typeof public private

Comments: Comments are a way to improve the readability of a program. While coding we use comments for a better understanding of code for other users. While execution of the code, compiler ignore the comments and compile the rest of the code. There are two ways to use comments :



Examples:

  • Hello World in TypeScript
  • Article Tags :