Image

TypeScript is an open source programming (♦ see DEF) language intended to optimize the use of JavaScript.

Appeared in 2012, it was created by Anders Hejlsberg within the Microsoft company.

Code Examples

→ Let's start with very simple codes. The more you progress, page after page, the more sophisticated the scripts will be. However, you must go over 30 to 40 pages per level, before moving on to the next step...

→ In order to evaluate your codes, click on the icon on the left at the bottom of the page (gears), then choose a compiler from the list that will be open in another tab. Finally, test your work.

NOW REPRODUCE AND IMMERSE YOURSELF!

C 0001 - Hello World !

Reproduce this code (please do not copy-paste!).

console.log('Hello world!');

C 0002 - Multiplication

Reproduce this code (please do not copy-paste!).

function multiply(a: number, b: number) { return a * b;
}

console.log(multiply(6,8))

C 0003 - Variables

Reproduce this code (please do not copy-paste!).

class NamedValue<T> { private _value: T | undefined;

constructor(private name: string) {}

public setValue(value: T) {
this._value = value;
}

public getValue(): T | undefined {
return this._value;
}

public toString(): string {
return `${this.name}: ${this._value}`;
}
}

const value = new NamedValue<number>('myNumber');

value.setValue(24);

console.log(value.toString()); // myNumber: 24
Image

CHOISISSEZ VOTRE COMPILATEUR

Reproduisez ce code, en choisissant l'un des compilateurs (♦ voir DEFci-dessous (ne copiez-collez pas ! Ce serait trop facile). Tous ont la même fonction, choisissez-en un en tenant simplement compte de vos préférences.

Lorsque vous copiez votre code, remplacez le code existant (par défaut) figurant déjà dans le compilateur, par le vôtre.

Attention ! Pour certains de ces compilateurs, vous devez vous-même choisir le langage de programmation, dans le menu qui vous est alors proposé. Bien évidemment, n'oubliez pas de cliquer sur RUN !

TypeScript Technical Specifications

Most Recent Versions

Tools And Methodologies

Tests

Info+ (TypeScript)

 Creation
» Creation date : 2012
* Created by Anders Hejlsberg at Microsoft
* Developed by Microsoft
* Written in Javascript and TypeScript
* Cross-platform
* Open Web Foundation License

Tools+ (TypeScript)

 Softwares & Frameworks

News

Tags
Image

Fond of Code TM © ®
2022 / All rights reserved - Protected Trademark/Logo

Legal structure based in
Nice - FRANCE / Montreal - CANADA
Only by appointment...

Image
Image