\newline Logo
Left arrow icon.
Go to Previous Chapter
Go to Previous Chapter
SECTION 19Destructuring Assignment
Course Thumbnail of Beginners Guide to TypeScript.Beginners Guide to TypeScript
  • CHAPTER 1
    Nested Destructuring
    • SECTION 1.1Nested Destructuring
    • SECTION 1.2TypeScript Considerations
  • CHAPTER 2
    Building a TypeScript and Node.js App
    • SECTION 2.1Building number-app
    • SECTION 2.2The html file
    • SECTION 2.3Serving the HTML
    • SECTION 2.4Trying it out
    • SECTION 2.5Building NumInfo
    • SECTION 2.6Adding a new route
    • SECTION 2.7Handling Form Submissions
    • SECTION 2.8Using fetch
    • SECTION 2.9Conclusion
  • CHAPTER 3
    ES2015 and TypeScript
    • SECTION 3.1ES2015
    • SECTION 3.2What We'll Cover Next
  • CHAPTER 4
    Building Attachment and Image for BufferUnderflow
    • SECTION 4.1Modeling Attachment and Image
    • SECTION 4.2Defining Attachment
    • SECTION 4.3Defining the Image
    • SECTION 4.4Using ImageFormat
    • SECTION 4.5Understanding static
    • SECTION 4.6Building a Summary with getSummary
    • SECTION 4.7Completed Image Code
    • SECTION 4.8Using Image
  • CHAPTER 5
    Abstraction and Polymorphism
    • SECTION 5.1Abstraction with Interfaces
    • SECTION 5.2Using Polymorphism
    • SECTION 5.3Understanding Abstract Classes
    • SECTION 5.4Conclusion
  • CHAPTER 6
    Generating the Budget Class
    • SECTION 6.1Budget Class
    • SECTION 6.2Five New Methods
    • SECTION 6.3Category enum
    • SECTION 6.4Grouping Expenses in a Budget
    • SECTION 6.5Putting It Together
  • CHAPTER 7
    Typing Functions - The Basics
    • SECTION 7.1Functions
    • SECTION 7.2Annotating Functions
    • SECTION 7.3Optional Parameters
    • SECTION 7.4Default Parameters
    • SECTION 7.5Rest Parameters
  • CHAPTER 8
    TypeScript Language Features
    • SECTION 8.1Introduction
    • SECTION 8.2Type Alias
    • SECTION 8.3Primitive Types
    • SECTION 8.4Number
    • SECTION 8.5String
    • SECTION 8.6Boolean
    • SECTION 8.7null and undefined
    • SECTION 8.8void
  • CHAPTER 9
    Typing Objects
    • SECTION 9.1Object Types
    • SECTION 9.2The object type
    • SECTION 9.3Typing object properties
    • SECTION 9.4Optional properties
  • CHAPTER 10
    Inheritance and Composition
    • SECTION 10.1Inheritance and Composition in TypeScript
    • SECTION 10.2Benefits of Inheritance
    • SECTION 10.3Where Inheritance Fails
    • SECTION 10.4Favor Composition
  • CHAPTER 11
    Where To Go From Here
    • SECTION 11.1TypeScript and React
    • SECTION 11.2TypeScript and Angular
    • SECTION 11.3TypeScript and GraphQL
    • SECTION 11.4Let us know what you think!
  • CHAPTER 12
    Compiling TypeScript to JavaScript
    • SECTION 12.1Compiling to JavaScript
    • SECTION 12.2Compiler Options
  • CHAPTER 13
    Union Types, Discriminated Unions, and Type Guards
    • SECTION 13.1Union Types Denote "or"
    • SECTION 13.2Discriminated Unions
    • SECTION 13.3Type Guards
  • CHAPTER 14
    Intersection Types
    • SECTION 14.1Intersection Types Express "and"
    • SECTION 14.2Optional Properties are Optional
    • SECTION 14.3Shared Properties are Intersections
  • CHAPTER 15
    Introduction to TypeScript and Node.js
    • SECTION 15.1Introduction
    • SECTION 15.2Working With The File System
    • SECTION 15.3Configuring Development Environment
    • SECTION 15.4Building fs-json
    • SECTION 15.5Typed JSON files
    • SECTION 15.6Express and TypeScript
    • SECTION 15.7Configuring Development Environment
  • CHAPTER 16
    let and const in TypeScript
    • SECTION 16.1let and const
    • SECTION 16.2TypeScript Considerations
  • CHAPTER 17
    Tracking Expenses by Month and Users
    • SECTION 17.1TrackedMonth Class
    • SECTION 17.2User Class
    • SECTION 17.3Conclusion
  • CHAPTER 18
    Generating Unique Ids
    • SECTION 18.1Generating Unique Ids For Each Expense
    • SECTION 18.2Add genUniqueId to Expense
    • SECTION 18.3Putting It Together
  • CHAPTER 19
    Destructuring Assignment
    • SECTION 19.1Destructuring Assignment
    • SECTION 19.2Destructuring Arrays
    • SECTION 19.3Destructuring Objects
  • CHAPTER 20
    Object Oriented TypeScript
    • SECTION 20.1Introduction
    • SECTION 20.2OOP Concepts in TypeScript
    • SECTION 20.3Encapsulation
    • SECTION 20.4Information Hiding
  • CHAPTER 21
    Classes in TypeScript: User and Expense
    • SECTION 21.1TypeScript Classes
    • SECTION 21.2Expense Class
  • CHAPTER 22
    Typing Functions with Overloading, Values, and Arrow Functions
    • SECTION 22.1Overloading
    • SECTION 22.2Functions as values
    • SECTION 22.3Arrow functions
  • CHAPTER 23
    Running BufferUnderflow
    • SECTION 23.1The Simulation Code
    • SECTION 23.2The Output
    • SECTION 23.3Conclusion and Review
  • CHAPTER 24
    Planning Our First TypeScript Application: FinanceMe
    • SECTION 24.1Building FinanceMe
    • SECTION 24.2Planning FinanceMe
    • SECTION 24.3Example Usage
    • SECTION 24.4Class Diagram of FinanceMe
  • CHAPTER 25
    Enhanced Object Literals
    • SECTION 25.1Enhanced Object Literals
    • SECTION 25.2Shorthand for property names
    • SECTION 25.3Shorthand for method names
    • SECTION 25.4Computed property names
    • SECTION 25.5TypeScript Considerations
  • CHAPTER 26
    Building the Question and Answer Models
    • SECTION 26.1Modeling Question and Answer
    • SECTION 26.2Building the Answer Model
    • SECTION 26.3Generating a Summary
    • SECTION 26.4Improving addAnswer
    • SECTION 26.5Adding Private Setters
    • SECTION 26.6Completed Answer Class
    • SECTION 26.7Defining the Question Class
    • SECTION 26.8Setting Answers
  • CHAPTER 27
    Imports and Exports with TypeScript Modules
    • SECTION 27.1TypeScript Modules
    • SECTION 27.2Named Exports and Imports
    • SECTION 27.3Default Exports and Imports
  • CHAPTER 28
    Lists with Arrays and Tuples
    • SECTION 28.1Arrays
    • SECTION 28.2Tuples
    • SECTION 28.3Optional Elements
  • CHAPTER 29
    Building the User Model
    • SECTION 29.1User.ts
    • SECTION 29.2Adding Questions and Answers
    • SECTION 29.3Getting the SUmmary
    • SECTION 29.4Permissions
    • SECTION 29.5The Finished User
    • SECTION 29.6Using the User model
  • CHAPTER 30
    Getting Started With TypeScript
    • SECTION 30.1Introduction
    • SECTION 30.2What is TypeScript?
    • SECTION 30.3JavaScript vs. TypeScript Example
    • SECTION 30.4Untyped JavaScript
    • SECTION 30.5Catching Errors with Types
    • SECTION 30.6Why Should I Use TypeScript?
  • CHAPTER 31
    Object Oriented in Practice with BufferUnderflow
    • SECTION 31.1Introduction
    • SECTION 31.2Code Examples
    • SECTION 31.3Unique Entity
    • SECTION 31.4getUniqueId
    • SECTION 31.5Summary Interface
    • SECTION 31.6Using the Interfaces
  • CHAPTER 32
    Setting Up Your TypeScript Development Environment
    • SECTION 32.1Setting up your development environment
    • SECTION 32.2Getting Started
  • CHAPTER 33
    Spread Operator
    • SECTION 33.1Spread Operator
    • SECTION 33.2Spreading Arrays
    • SECTION 33.3Spreading Objects
    • SECTION 33.4TypeScript Considerations
  • CHAPTER 34
    Changelog
    • SECTION 34.1Revision 3
    • SECTION 34.2Revision 2
  • CHAPTER 35
    Enums are for named constants
    • SECTION 35.1Enums
    • SECTION 35.2Enums have a value
    • SECTION 35.3Reverse Mappings
Right arrow icon.
Go to Next Chapter
Go to Next Chapter
SECTION 21Classes in TypeScript: User and Expense
  • Go Pro
  • Log In

Object Oriented TypeScript

Table of Contents
  • Section 20.1Introduction
  • Section 20.2OOP Concepts in TypeScript
  • Section 20.3Encapsulation
  • Books
  • Beginners Guide to TypeScript
  • Object Oriented TypeScript
  • Go To Previous Lesson
    Destructuring Assignment
    Destructuring Assignment
  • Go To Next Lesson
    Classes in TypeScript: User and Expense
    Classes in TypeScript: User and Expense