Skip to content

ChinmayeeMestry/typescriptBasics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

typescriptBasics

Table of Contents

Questionaries 27 April 2021

Understanding Typescript

Perform following activities -

  1. Create a simple function which helps to multiply 4 numbers with following criteria -
  • 3 numbers must be compulsory, 1 must be optional
  • Out of 3 compulsory numbers, 1 must have default value
  • The function must print the multiplication of 4 numbers
  1. Create an interface that define the characteristic properties of a car -
  • model
  • color
  • year of manufacture
  • Create a function that takes this value as its parameter and simply print the properties.
  1. Create a class 'Vehicle' with
  • Class properties 'model', 'color', 'year of manufacture'.
  • Class constructor to manage these properties
  • Simple method to print these properties
  1. Also, create a child class 'Car' of above 'Vehicle' class with
  • Class properties 'seating capacity(number of persons that sit)'
  • Class constructor to manage these properties
  • Simple method to print these properties along with the properties of class Vehicle
  • Make sure that the 'Vehicle' class properties should only be available to itself as well as child class 'Car' but not outside.

Steps to install

git install -g typescript
git clone https://github.com/ChinmayeeMestry/typescriptBasics.git

Steps to execute

cd typescriptBasics
tsc filename.ts && node filename.js
example: tsc interface.ts && interface.js

Happy Coding !! All the Best

About

Understanding Typescript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published