Git Product home page Git Product logo

typescript-workshop-exercises's Introduction

Introduction to TypeScript

Getting Started

Run:

npm install -g typescript@latest
npm install

Most of the exercises in this repo don't compile properly (it's your job to fix them!), but to make sure your environment is set up properly, start by running the Frankenstein script: npm run frankenstein

If this succeeds, you can continue with the exercises. You can run them in the same way you brought Frankenstein to life, e.g.: npm run variableTypes

Once you've completed the first file, replace the filename with the next test file and keep going.

Linting

TypeScript works best in conjunction with linting. If you haven't used it before, linting is like the green underline in a Word document - it isn't a typo (won't break your code), but there's an issue nonetheless and it's a good idea to fix it.

To run the linter in this project: npm run lint

Some of the things the linter picks up (that the TypeScript compiler doesn't) include:

  • Missing return type on a function
  • Explicit 'any' type used (instead of using 'any', try union types.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.