プログラミング学習日記

プログラミング学習時のメモ帳。

TypeScript

typescript enum型

JavaScriptでは存在しないenum列挙型はtypeScriptでは存在する 基本の形 Fruit.ts enum Fruit { apple = 'りんご', grape = 'ぶどう', orange = 'みかん' } console.log(Fruit.apple); 出力 りんご enum型のFruitを定義して出力する. 定義する際には全て初期…

JavaScript Promise

promiseが出てきたので勉強しておく Prionmiseとは特定のコードの実行が終わった後に別のコードを実行させることができる. 一つ目の実行が終了されるのを待つことができる. プレースホルダのようなものらしい. 「わかりそう」実行終了結果を使いたいときに大…

TypeScript Classの継承

前回Classを作成したのでその発展としてクラスの継承をしましょう. class Person { name : string; age : number; constructor( name : string , age : number ){ this.name = name; this.age = age; } SayHello( ) { console.log(`Hello! I am ${ this.name…

TypeScript classを扱う

TypeScriptで初めてClassを扱うのでメモを残しておく. TyepeScriptのclassはC#やJavaのClasstと似ています. classの定義 class Person { name: string; constructor(name: string) { this.name = name; } } Personクラスを定義しています. プロパティとしてn…

ブログを見ていただきありがとうございました