際際滷

際際滷Share a Scribd company logo
INTRODUCTION TO
TYPESby Bo Andersen - codingexplained.com
WHAT ARE TYPES?
 Declaring a variable as a particular type, instead of any type like in normal JavaScript
 A variable cannot contain values of other types
 Types are checked at compile time
 Types included in TypeScript: boolean, number, string, array, enum, any, void
 Possible to create one's own types
 Types are optional and are not part of the outputted JavaScript
var occupation: string = "Developer";
BENEFITS OF TYPES
 Type errors are discovered at compile time
 Increased IDE assistance
 The language automatically ensures better code
 Simplifies code & makes it easier to understand
 Increased maintainability
THANK YOU FOR
WATCHING!

More Related Content

Introduction to Elasticsearch Types

  • 1. INTRODUCTION TO TYPESby Bo Andersen - codingexplained.com
  • 2. WHAT ARE TYPES? Declaring a variable as a particular type, instead of any type like in normal JavaScript A variable cannot contain values of other types Types are checked at compile time Types included in TypeScript: boolean, number, string, array, enum, any, void Possible to create one's own types Types are optional and are not part of the outputted JavaScript var occupation: string = "Developer";
  • 3. BENEFITS OF TYPES Type errors are discovered at compile time Increased IDE assistance The language automatically ensures better code Simplifies code & makes it easier to understand Increased maintainability