Identifiers and Keywords in TypeScript Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report In TypeScript, identifiers are names used for variables, classes, or methods and must follow specific naming rules. Keywords are reserved words with predefined meanings and cannot be used as identifiers. Comments, both single-line and multi-line, enhance code readability and are ignored during code execution.Identifiers Identifiers are nothing but the names given to any class members like a variable, method name, class name, array name, etc. Certain rules to be followed while declaring Identifiers: Identifier names can start with both upper-case as well as lower-case letters but can't start with numbers. Only _ and $ symbols can be used for giving names to Identifiers, apart from these symbols, no other special symbol can be used. Keywords are different from Identifiers. The identifier is case-sensitive and doesn't contain spaces.Examples of Valid and Invalid Identifiers:ValidInvalidgeeksforgeeks1$geeksforgeeksgeeks_for_geeks#geeks$geeksgeeks-for-geeks_geeks$anyKeywords: 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 asanyswitchcaseifthrowelsevarnumberstringgetmoduletypeinstanceoftypeofpublicprivateComments: 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 : Single-line comments ( // )Multi-line comments (/* */)Examples:Hello World in TypeScript Comment B bishaldubey Follow Improve B bishaldubey Follow Improve Article Tags : TypeScript JavaScript-Questions Explore TypeScript Tutorial 8 min read TypeScript BasicsIntroduction to TypeScript 3 min read Difference between TypeScript and JavaScript 4 min read How to install TypeScript ? 3 min read Hello World in TypeScript 2 min read How to execute TypeScript file using command line? 2 min read Variables in TypeScript 6 min read What are the different keywords to declare variables in TypeScript ? 4 min read Identifiers and Keywords in TypeScript 2 min read TypeScript primitive typesData types in TypeScript 3 min read TypeScript Numbers 4 min read TypeScript String 4 min read Explain the concept of null and its uses in TypeScript 3 min read TypeScript Object typesWhat are TypeScript Interfaces? 4 min read TypeScript class 4 min read How enums works in TypeScript ? 4 min read TypeScript Tuples 4 min read TypeScript other typesWhat is any type, and when to use it in TypeScript ? 3 min read How to Create an Object in TypeScript? 4 min read What is an unknown type and when to use it in TypeScript ? 3 min read Explain the purpose of never type in TypeScript 3 min read TypeScript combining typesTypeScript Union 3 min read What are type aliases and how to create it in Typescript ? 3 min read TypeScript AssertionsExplain Type assertions in TypeScript 3 min read TypeScript FunctionsHow to write a function in Typescript ? 4 min read How to achieve function overloading in TypeScript ? 2 min read Explain the arrow function syntax in TypeScript 2 min read TypeScript toPrecision() Function 1 min read TypeScript toFixed() Function 2 min read TypeScript toLocaleString() Function 2 min read TypeScript toString() 1 min read TypeScript interfaces and aliasesWhat are TypeScript Interfaces? 4 min read What are type aliases and how to create it in Typescript ? 3 min read TypeScript classesHow to Extend an Interface from a class in TypeScript ? 2 min read How to Create an Object in TypeScript? 4 min read How to use getters/setters in TypeScript ? 5 min read TypeScript Inheritance 3 min read When to use interfaces and when to use classes in TypeScript ? 4 min read Generics Interface in typescript 5 min read How to use property decorators in TypeScript ? 4 min read Like