TypeScript is a popular open-source programming language developed and maintained by Microsoft. It is a statically typed superset of JavaScript that adds optional static typing and other features to help developers write more robust and maintainable code.
TypeScript compiles to plain JavaScript, making it compatible with all JavaScript environments and runtimes.
Related Tags
Tutorials
In TypeScript, an array of objects is a collection of items where each item is an object. Arrays of objects are commonly used to organize complex data structures, such as user information, products, or any other entity, into manageable collections.
In TypeScript, an array of vectors is a collection of vectors, where each vector can represent an array of numbers or custom objects. This multi-dimensional array structure is handy in scenarios such as mathematical computations, graphics programming, or handling grouped data in a type-safe and organized manner.
In TypeScript, method overriding allows derived classes to provide a specific implementation for a method that is already defined in a base class.
TypeScript examples to create of objects that adhere to interface definitions, without requiring explicit class implementations.
TypeScript instanceof operator checks the type of an object at runtime. Learn to use it with a class, interface, or even an array with examples.
Learn the differences between a class and an interface in Typescript including syntax, extensibility, usage and code after compilation with examples.
In this TypeScript tutorial, we will learn about generic interfaces, classes, and methods and explore their syntax, usage, and benefits.
Learn to create derived interfaces, in TypeScript, by extending a single or multiple interfaces, interface merging, and intersection types with examples.
Learn the basics of creating an interface, adding fields (optional and read-only) and methods, and implementing an interface in another object with examples.
Learn TypeScript error handling using try, catch, finally blocks and throw statement. Also, learn built-in error types as well as the custom exceptions.
Learn the syntax, simple examples and noticeable differences between TypeScript Array’s map() and flatMap() operations with examples.
Let us explore the syntax, provide simple examples, and outline the differences between Record type and Map data structure in TypeScript.
TypeScript Record is a utility type that creates an object type where the keys and the values associated with those keys are of the specified types.
TypeScript is a modern language and the superset of JavaScript with additional features such as type safety, readability and maintenance.
In TypeScript, the default and optional parameters provide a convenient way to APIs with variable number of arguments with sensible defaults.
Typescript array slicing creates a new array containing shallow copies of the selected elements from the source array without modifying the source array.
Learn to remove or pop items from an array in TypeScript using pop(), shift(), splice(), filter() and delete operator with examples.
Learn to add or append or push new items into an array in TypeScript. Also, learn to append or merge an array into a specified array.
Learn to create new Date objects in TypeScript, and modify, compare and format them to custom and inbuilt locale-specific patterns.
Learn how to find an element in an array using inbuilt methods or write custom logic using examples in JavaScript or TypeScript.
TypeScript is an open-source programming language that was developed and maintained by Microsoft in 2012. TypeScript brings ‘types’ (or datatypes) to JavaScript making a strongly typed language. This page lists down all the TypeScript tutorials posted on this blog for easy navigation. 1. TypeScript Basics 2. TypeScript Types 3. TypeScript …
In TypeScript, filter(testFunction) is a built-in function available for arrays that returns a new array of elements satisfying a given condition.
TypeScript supports callback functions to make your program asynchronous. A callback function is a function which is scheduled to be called after some asynchronous processing is completed.
In TypeScript, function overloading, or method overloading, is the ability to create multiple methods with the same name and a different number of parameters or types.
Learn to create functions in typescript and function type declaration. We will also see how to declare and pass optional parameters, setting default value for any parameter; and rest parameters with easy-to-follow examples. Table of Contents 1. Creating a function 2. Function Types 3. Optional Parameters 4. Parameters with Default …
A typescript template string (or template literal) is a regular JavaScript string which is enclosed within the back-tick characters (`) seeded with multiple placeholders denoted with ${ }. At runtime, the code replaces the placeholders with their real values. The process of evaluating a template literal containing one or more …
Set is a new data structure introduced in ES6. It allows to store distinct values into a List. Learn to create set, add and iterate set values.
Map is a new data structure introduced in ES6, to store key-value pairs. Learn to create map, add, delete, retrieve and iterate over Map entries.
In TypeScript, You can iterate over iterable objects (including array, map, set, string, arguments object and so on) using for…of loop. To be an iterable, an object must implement the @@iterator method.
TypeScript compiler uses tsconfig.json to get configuration options for generating JavaScript code from TypeScript sourcecode. When you uses $ tsc command to compile TypeScript code, compiler searches for configurations loaded in tsconfig.json.
In TypeScript, string literals allow you to specify the exact value a string must have in it’s lifespan. You can assume it a form as ‘string based enum’ which also is named group of string constants.
In TypeScript, enums are set of named constants. Though it is optional, but enums should be a named group of related constants. TypeScript supports both traditional enums and string-based enums.
Learn to create an array, add/remove items, and iterate over array items along with cloning and merging the arrays in TypeScript.
In JavaScript, a variable is said to be “undefined” if it has been declared but not initialized. Whereas “null” is assigned to a variable whose value is absent at the time of initialization. In simple words, when we do not assign any value to a variable, the JavaScript engine treats …
In TypeScript, a union type variable is a variable which can store multiple type of values (i.e. number, string etc). A union type allows us to define a variable with multiple types. The union type variables are defined using the pipe (‘|’) symbol between the types. The union types help …
In TypeScript (or JavaScript), we can compare the two variables with either equality operator (‘==’) or strict equality operator (‘===’). Both comparison operators seems almost similar; but the way, they compare two given variables, is very different. The equality operator compares only the value after applying the type coercion, if …
The spread operator is a new addition to the features available in the JavaScript ES6 version. The spread operator is used to expand or spread an iterable or an array in Typescript or Javascript. 1. When to use the Spread Operator? The spread operator (in the form of ellipsis) can …
TypeScript logical operators are similar to what we have learned in JavaScript logical operators. These operators help in comparing boolean expressions and producing a single boolean value as result. 1. Logical Operators Operator Description Logical AND operator – && If both operands (or expressions) are true, then result will be …
TypeScript comparison operators are the same as JavaScript. Comparison operators help in comparing two variables by their values. Please note that some operators use type coercion while comparing the values, while some do not. Please use them carefully. Type coercion means that when the operands of an operator are different …
TypeScript supports type checking for all primitive types and object types. TypeScript also supports generics, decorators, and ES6 module types as well. It is important to learn that the type system in typescript is designed to be optional. So all programs written in JavaScript are TypeScript programs as well. Table …
In this TypeScript tutorial, learn to basics, compiler, installation and how to start development in TypeScript language with examples.
An operator is a symbol that represents a specific action. An arithmetic operator can be used with one or more than values to produce a single value. In typescript, we can perform arithmetic operations using below given 10 operators. Arithmetic operators Operator Name Description and Example x + y Addition …
In vanilla JavaScript, variables are declared using ‘var‘ keyword. In version ES6, we can define the variables using let and const keywords too. All three keywords have similar syntax for variable declaration and initialization, but they differ in their scope and usage. 1. Differences between var, let and const We …
Variable hoisting in JavaScript means to move all variable declarations to top of function. This means that if we declare a variable at the end of a function, the runtime will hoist it to the top and we will not have any error if we would have used that variable …
In JavaScript, Truthy expressions evaluate to boolean true value and Falsy expressions evaluate to boolean false value. Unlike other programming languages, truthy and falsy values are not limited to boolean data types and comparisons. They can have many other forms. Let us learn what makes an expression truthy or falsy …
Transpilers, or source-to-source compilers, are tools that read the sourcecode written in one programming language and produce the equivalent code in another programming language with a similar level of abstraction. A good example of transpiler is the Typescript transpiler which converts Typescript code to JavaScript. Similarily, Babel transpiler can also …