Category: TypeScript

  • Operators

    What is an Operator? An operator defines some function that will be performed on the data. The data on which operators work are called operands. Consider the following expression − 7 + 5 = 12 Here, the values 7, 5, and 12 are operands, while + and = are operators. The major operators in TypeScript can be…

  • Variables

    A variable, by definition, is “a named space in the memory” that stores values. In other words, it acts as a container for values in a program. TypeScript variables must follow the JavaScript naming rules − A variable must be declared before it is used. Use the var keyword to declare variables. Variable Declaration in TypeScript The…

  • Types

    The Type System represents the different types of values supported by the language. The Type System checks the validity of the supplied values, before they are stored or manipulated by the program. This ensures that the code behaves as expected. The Type System further allows for richer code hinting and automated documentation too. TypeScript provides…

  • Basic Syntax

    Syntax defines a set of rules for writing programs. Every language specification defines its own syntax. A TypeScript program is composed of − Your First TypeScript Code Let us start with the traditional “Hello World” example − var message:string=”Hello World”console.log(message) On compiling, it will generate following JavaScript code. Compile and Execute a TypeScript Program Let…

  • Environment Setup

    We already have set up TypeScript programming online, so that you can execute all the available examples online at the same time when you are doing your theory work. This gives you confidence in what you are reading and to check the result with different options. Feel free to modify any example and execute it…

  • Overview

    JavaScript was introduced as a language for the client side. The development of Node.js has marked JavaScript as an emerging server-side technology too. However, as JavaScript code grows, it tends to get messier, making it difficult to maintain and reuse the code. Moreover, its failure to embrace the features of Object Orientation, strong type checking…