0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Typescriptとは何か?

Posted at

TypeScript はマイクロソフトによって開発され、
メンテナンスされているフリーでオープンソースのプログラミング言語です。

TypeScriptはJavaScriptに対して、省略も可能な静的型付けと
クラスベースオブジェクト指向を加えた厳密なスーパーセットとなっています。

Javascriptにコンパイルされる、静的型システムがついたJavascriptの上位集合です。

↓TypeScriptを使う3つの理由

ドキュメントとしての側面

tsc command = type script compiler

index.ts
let hello : string = "hello";
console.log(hello);
% tsc index.ts

とすると
Image from Gyazo
同じ名前の拡張子jsファイルが生成されます。

% node index.js

と打つと

 hello

と出力されます。


Linterとしての側面

thanks.ts
console.log(thanks);

この一行だけの状態でtsc すると
Image from Gyazo
コンパイルする時点でエラーを伝えてくれます。


ダウングレードESへのコンパイラとしての側面

ES3、4、5、6、next
どこまで対応できるかを載っけたもの↓

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?