Author: saqibkhan

  • 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…

  • Features

    TypeScript is a superset of JavaScript. So, it contains all the features that JavaScript has. However, it also contains some advanced features that JavaScript doesn’t have like static typing, interface, etc. Let’s discuss some of the important features of TypeScript. Type Annotation In TypeScript, type annotation allows you to declare the type of variable, function…

  • TypeScript vs. JavaScript

    TypeScript and JavaScript are the most popular programming languages widely used in web development. If you are a web developer, you must have heard about them. Do you know the difference between JavaScript and TypeScript, or have you ever been confused about choosing between them? If yes, we have covered the difference between them, which…

  • 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 − Open Compiler On compiling, it will generate following JavaScript code. Compile and Execute a TypeScript Program Let us…

  • 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…

  • setInterval() Method

    JavaScript setInterval() Method In JavaScript, the setInterval() is a window method that is used to execute a function repeatedly at a specific interval. The setTimeout() Method allows you to execute the function only once after the specified time. The window object contains the setInterval() method. However, you can execute the setInterval() Method without taking the…

  • setTimeout() Method

    JavaScript setTimeout() Method In JavaScript, the setTimeout() is a global method that allows you to execute the function or a particular JavaScript code only once after a specified time. The window object contains the setTimeout() method. You may use the window object to execute the setTimeout() method. The setTimeout() method can also be used to…

  • Timing Events

    What are the Timing Events? JavaScript timing events are used to execute the code after a specified time only once or multiple times. In JavaScript, you can use the timing events to control when a particular task should be executed. The ‘window’ object contains the various methods for timing events, which you can use to…

  • Promises Chaining

    The promise chaining in JavaScript can handle multiple related asynchronous operations even with a single promise. While a single promise handles a single asynchronous operation, the promise chaining allows you to create a sequence of promises. Here success or rejection of one promise triggers the execution of the next promise. This enables you to handle multiple asynchronous operations. In…