Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
TypeScript勉強記_Week2
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
ko-chan
October 02, 2023
0
390
TypeScript勉強記_Week2
- 基本の書き方【更新】
- noImplicitAny
- デフォルト関数パラメータ
- スプレッド構文(内容更新予定)
- 残余引数(内容更新予定)
- 型
- よく見られる型リスト
ko-chan
October 02, 2023
Tweet
Share
More Decks by ko-chan
See All by ko-chan
TypeScript勉強記_Week5
kochan648
0
150
TypeScript勉強記_Week4
kochan648
0
210
TypeScript勉強記_Week3
kochan648
0
290
TypeScript勉強記_Week1
kochan648
0
420
Featured
See All Featured
HDC tutorial
michielstock
1
380
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.2k
How to Ace a Technical Interview
jacobian
281
24k
Building Adaptive Systems
keathley
44
2.9k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
910
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
240
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
76
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
290
Transcript
文系出身プログラミング未経験人の TypeScript 勉強記 ~Week 2~
noImplicitAny →解決策 例:他の関数の引数にアロー関数を直接書く場合 ・オプションが有効な時 引数のカッコを省略したアロー関数はコンパイルエラーとなる noImplicitAny:暗黙のanyを禁ずるコンパイラオプション
デフォルト関数パラメータ デフォルトで値を設定できる ※注意 ・デフォルト側は右側のパラメータにしか設定できない (JS,TSではパラメータの順序変更ができない) ・デフォルト値のあるパラメータをスキップして、その後ろのパラメータを渡す呼び方ができない
スプレッド構文【展開】 文字列や配列、オブジェクトの中身を展開できる構文 ・要素を指定して取り出すのは JSの基本的な構文 ・hobbiesの配列に要素を追加 ・pushを使って、定数に更に値を追加 ・スプレッド演算子:配列から全ての値を取り出す時に便利
レスト構文(残余引数)【集約】 複数の要素を一つにまとめることができる構文 ・「...」を引数の前に書く 受け取った残余引数は配列になる [ 1, 2, 3 ] ・通常の引数と残余引数が作成できる
※注意 ・残余引数は必ず最後の引数であること ・複数の残余引数は✖ ・残余引数の後に通常の引数は置けない
第2章 型 TypeScriptは静的型付け言語、データ型の指定を明示的に行うことができる number 1, 3,7, -12 整数や浮動小数点を含む全ての数値 string ‘Hello‘,
“Hello“, `Hello` 全ての文字列 boolean true, false true or false object {age: 23} 複数のプロパティとメソッドを持つことが できるデータ型【修正】 array [1, 2, 3, 4, 5] 数値や文字列など、型の要素の 集まりを格納【修正】 tuple [1, 2] TS独自の型:長さ固定の配列 enum enum { NEW, OLD } TS独自の型:列挙型 any * どんな値でもok、型を指定しない よく見られる型リスト