Skip to content

Latest commit

 

History

History
62 lines (52 loc) · 2.89 KB

README.md

File metadata and controls

62 lines (52 loc) · 2.89 KB

Module 1 - Javascript

Projects:

fun-with-js Introduction to some javascript gotchas
fun-with-nodejs Working with Typescript - how to create development environment
ts-basic-types About the basic types of typescript

Javascript types and gotchas

  • We have Convered the 6 types of javascript: boolean, number, string, object, function, and undefined
  • We have seen how to use JSON to describe complex object values
  • We have seen the true meaning of the new and this keywords, and most specifically - that they do not have the same meaning as in Java.
  • We have experienced the problem of the missing this context
  • We learned about javascript scopes and Closures
  • We learned about the prototype object and property

NodeJS

  • We learned the difference between serverside javascript (NodeJS) and clientside web javascript
    • We talked about modularity and the require keyword
    • We talked about webpack - a utility to pack "serverside" javascript files into one "web-ready" file

Work Environment

  • We saw how to turn a folder into an npm package by running npm init
  • We saw how to use the node.js require command in order to incorporate another module (file) into our code
  • We saw how the package.json file manages the project as a package.
  • We saw how to install external packages using npm install and the package.json > dependencies section
  • We talked about the diffrence between dependencies and devDependencies
  • We saw how to use scripts in node.js
  • We saw how to install the typescript compiler into the package
  • We saw how to create the tsconfig.json file and configure different aspects of the typescript project
    • What the target version of javascript is
    • Where to locate the source files
    • Where to place the compiled files
    • Libreries to include
    • Adding map files to support debugging
    • Running in the compiler in watch mode for continous compilation
  • We saw how to configure the VS Code Debugger for work with our node.js project

Typescript basics

  • We learned about the basic types of typescript
    • The 6 atomic types of javascript: boolean, number, string, object, function and undefined
    • Typed arrays: number[] and Array<number>
    • Tuples: [number, number], [string, boolean, number]
    • Fixed object notation: {x: number, y: boolean}
    • Flexible object notation: {[key: string]: number} and the equivilent: Record<string, number>
    • Function notation: (x: number, y: string) => boolean

Typescript deep dive

  • Using the let keyword
  • Defining Classes
  • Declaring constructors and initializing fields in the constructor signature
  • private, public and protected fields
  • Using interfaces
  • Typescript definition for Type Safety as "signature compatible"
  • Union Types
  • Cross Types
  • the type alias