Easy learning with example program codes

TypeScript Data Types system

When a variable is declared some part of memory is reserved. But how much memory will be reserved. It depends upon the data type of the variable.  i.e. how much memory will be reserved and which type of data can be stored in reserved memory is depends upon data type of the variable. The Type System of a language represents these data types.

Data types in TypeScript:

  1. Any Type: represents the super type of all data types in TypeScript. TypeScript provides the compile time data type-checking for the variables. In some situation we may not know what type of value for variable will come. These values may come from dynamic content e.g. from the user. In such cases, we want to opt-out of type-checking and let the values pass through compile-time checks. The any type is used for these variables.

  2. Built-in types:
  3. Data type Keyword Description
    Number number It represents a double precision 64-bit floating point values which can be used to represent both integers and fractions.
    String string It represents a sequence of characters.
    Boolean boolean It represents logical values true and false.
    Void void It is used on function return types to represent non-returning functions.
    Null null It is used to represent an intentional absence of an object value.
    Undefined undefined It represents uninitialized variables.
  4. User-defined types: include Enumerations (enums), classes, interfaces, arrays, and tuple.

TypeScript Tutorial

TypeScript Overview.
Typescript vs Javascript.
Typescript let vs var.
TypeScript Hello World.
Typescript Data Types.
Typescript Variable Declaration.
TypeScript operators list.
TypeScript Arithmetic Operators.
TypeScript Comparison Operators.
TypeScript Bitwise Operators.
Typescript Logical Operators.
TypeScript Assignment Operators.
Typescript Conditional Operator.
Typescript String Operator.
Typescript typeof Operator.
TypeScript control statements.
TypeScript Switch Statement.
TypeScript for loop.
TypeScript for in loop.
TypeScript while loop.
TypeScript do while loop.
Typescript for loop break.
TypeScript for loop continue.
Typescript function.
Typescript returning function.
Typescript parameterized function.
Typescript function optional parameter.
Typescript rest parameters.
Typescript default parameters.
Typescript anonymous function.
Typescript function constructor.
Typescript Arrow/Lambda function.
Typescript function overloading.
TypeScript number object.
TypeScript string object.
TypeScript boolean object.
TypeScript date object.
TypeScript math object.
TypeScript array object.
TypeScript tuples.
TypeScript union type.
TypeScript interface.
TypeScript interface inheritance.
TypeScript interface multiple inheritance.
TypeScript class.
Typescript class inheritance.
Typescript class interface.
TypeScript abstract class.
TypeScript object.
TypeScript duck typing.
TypeScript NameSpace.
TypeScript Multi-file namespaces.
TypeScript module.
TypeScript ambient module.

Copyright © 2018 CodesJava Protection Status SiteMap