Skip to content

seanpm2001/Learn-TypeScript


/Typescript_logo_2020.svg

Learning TypeScript (programming language)

I know very little about the TypeScript programming language. This document will go over all of my knowledge of the TypeScript programming language.

Hello World in TypeScript

This is how you make a Hello World program in TypeScript:

var helloWorld:string = "Hello world";
console.log(helloWorld);

Comments in TypeScript

Comments in TypeScript are identical to comments in Java, JavaScript, C#, etc.

// This is a single line comment
/* This
is a multiline
comment */
/* Multi-line comments
* can also
* be written
* like this */

Break keyword in TypeScript

break;

To this day, I am still not entirely sure what the break keyword does, but most languages support it.

/!\ This example has not been tested yet, and may not work

Other knowledge of the TypeScript programming language

  1. TypeScript is a language by Microsoft

  2. TypeScript is a semicolon and curly bracket language

  3. TypeScript uses the *.ts file extension

  4. TypeScript also uses the *.tsx file extension for TypeScript scripts that use JSX source code

  5. TypeScript was influenced by C#, Java, and JavaScript

  6. Any valid TypeScript source code is valid JavaScript source code, and vice versa

  7. TypeScript is one of the top 50 programming languages (as of 2022)

  8. TypeScript is a language that compiles to JavaScript. I am unsure if the TypeScript alone (uncompiled) can do anything useful

  9. No other knowledge of the TypeScript programming language


File info

File type: Markdown document (*.md *.mkd *.mdown *.markdown)

File version: 2 (2022, Monday, July 25th at 5:45 pm PST)

Line count (including blank lines and compiler line): 117


File history

Click/tap here to expand/collapse the history for this file

Version 1 (2021, Friday, November 26th at 4:41 pm PST)

Changes:

  • Started the file
  • Added the title section
  • Added the hello world in TypeScript section
  • Added the comments in TypeScript section
  • Added the break keyword in TypeScript section
  • Added the other knowledge of the TypeScript programming language section
  • No other changes in version 1

Version 2 (2022, Monday, July 25th at 5:45 pm PST)

Changes:

  • Updated the other knowledge of the TypeScript programming language section
  • Added the file info section
  • Added the file history section
  • No other changes in version 2