Introduction to TypeScript

Introduction to TypeScript

    let example1: boolean = true;
    let example2: number = 35;
    let example3: string = 'Hello World';
            <link rel="stylesheet" href="index.css">
            <script src="index.pack.js"></script>
    let example1: boolean = true;
    let example2: number = 35;
    let example3: string = 'Hello world';
    const arrayExample = [1, 3, 4, 5];
    let example1: boolean | number = 35;
    let example2 = arrayExample.reduce((num1, num2) => num1 + num2);
    let example3 = 'Hello world';
    let example4: undefined = undefined;
    let example5: null = null;
    import { Bear } from './bear.model'; 
    const bear = new Bear(3);
    if (bear instanceof Bear) {
        console.log("Hello from TypeScript");
    let definetlyNotAString: any = 'I am a string';
    let strLength = (<string> definetlyNotAString).length;
    const example1: string[] = ['Hello World'];
    const example2: (number | boolean)[] = [1, 2, true];
    const example3: boolean[] = [true, false];
    const exampleTuple: [string, number] = ['', 30];
    export enum Names {
    const example1: object = undefined;
    const example2: Object = undefined;
    const example3: {} = undefined;
    import { Person } from './person.model';
    function add(val1: number, val2: number) {
        return val1 + val2;
    add(1, 10);
    function sayHello(person: Person) {
        return `Say Hello to My Little Friend, ${person.firstName}!`    
    sayHello(new Person({}))
    import { Person } from './person.model';
    function add(val1: number, val2: number): number {
        return val1 + val2;
    function sayHello(person: Person): string {
        return `Say Hello to My Little Friend, ${person.firstName}!`    
    function voidExample(): void {
    type person = {firstName: string};
    const example1: object = undefined;
    const example2: Object = NaN;
    const example3: person = {firstName: 'Dollan'};
    example3.firstName = 'Dylan';
    export interface Person {
        firstName: string;
        lastName: string;
    export * from './bear.interface';
    export * from './man.interface';
    export * from ''
    import { Person } from './person.model';
    const example1: Person = {firstName: 'Dollan', middleName: 'Dollan', lastName: 'Dollan'};
    example1.firstName = 'Dylan';
    example1.middleName = 'Coding God';
    example1.lastName = 'Israel';
    import { Bear, Man, Pig } from './interfaces';
    let man: Man | Pig;
    let bear: Bear;
    let pig: Pig;
    type ManBearPig = Bear & Man & Pig
    let manBearPig: ManBearPig ;
    manBearPig.firstName = 'Dylan';
    manBearPig.claws = 3;
    manBearPig.bacon = false;
    function example<T>(arg: T[]): T {
        return arg;
    import { Animal } from './animal.model';
    export class Bear extends Animal{
        public claws: number;
        readonly name: string;
        private tail: boolean;
        constructor(data?: any) {
            this.claws = data.claws;
            this.tail = data.tail;
            <script src="index.pack.js"></script>

Learn the basics of TypeScript in less than an hour ⚡️

TypeScript is a typed superset of JavaScript, aimed at making the language more scalable and reliable. This course will teach you everything you need to know in order to get started with TypeScript. It contains 21 interactive screencasts, and in serveral of them you'll be challenged to solve interactive tasks, so that we're sure you've understood the concepts.

It's important that you have a basic understanding of JavaScript before taking this course. If you need a refresher, please check out our Introduction to JavaScript course here.

What you'll learn:

  • Basic variable types: any, boolean, number, string, undefined, null
  • Multiple types
  • let, const
  • Implicit vs explicit types
  • Checking types with instanceOf
  • Type assertions
  • Objects, arrays
  • Tuples, enums
  • Functions: parameters & return types
  • Custom types
  • Models
  • Interfaces
  • Barrels
  • Intersection types
  • Generics
  • Access modifiers
  • How to setup TS locally
  • TSLint

About the instructor:

The instructor Dylan Israel runs the popular YouTube channel Coding Tutorials 360 and he has also previously created two successful Scrimba courses, so you can rest assured that you're in good hands.