Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
TypeScript勉強記_Week4
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
ko-chan
October 13, 2023
220
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
TypeScript勉強記_Week4
・JavaScript
-繰り返し処理
-for文
-while文
-do…while文
・型
- object型【追記】
ko-chan
October 13, 2023
More Decks by ko-chan
See All by ko-chan
TypeScript勉強記_Week5
kochan648
0
160
TypeScript勉強記_Week3
kochan648
0
300
TypeScript勉強記_Week1
kochan648
0
430
TypeScript勉強記_Week2
kochan648
0
400
Featured
See All Featured
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
430
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
320
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
630
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
43k
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Transcript
文系出身プログラミング未経験人の TypeScript 勉強記 ~Week 4~
第0章 JavaScript TypeScrptはJavaScriptを書きやすくしたプログラミング言語 JavaScriptを理解していないとTypeScriptは書けない!
0-1 繰り返し処理 for文で指定した数だけ処理ができる 書き方 ①let i = 1; で初期化式を1回実行 ②iが4未満はtrueという
i<4; 条件式 ③変化式 i++; で変数の値に1が加算される ④2回目の処理からは初期化されない ⑤4になるとfalseになり’ダァー!’と出力 実行内容
様々な活用方法 結果を2の倍数に(2ずつ増加) 1ずつ減少 配列の要素数を取得して順に取り出す カンマ演算子で複数の変数を同時変化
for文の中でfor文 for文の中でfor文を実行 書き方 実行結果 i=1 j=1 k=1 i=1 j=1 k=2
i=1 j=1 k=3 i=1 j=1 k=4 i=1 j=2 k=1 i=1 j=2 k=2 i=1 j=2 k=3 i=1 j=2 k=4 i=1 j=3 k=1 i=1 j=3 k=2 i=1 j=3 k=3 i=1 j=3 k=4 i=1 j=4 k=1 i=1 j=4 k=2 i=1 j=4 k=3 i=1 j=4 k=4 i=2 j=1 k=1 i=2 j=1 k=2 i=2 j=1 k=3 i=2 j=1 k=4 ・ ・ ・ ・ ・ ・ i=4 j=4 k=4 外側のfor文で繰り返し処理が 1回される と、ブロック内に記述され for文が最初から 最後まで実行される
多重ループ for文の中に入れ子でfor文を実行してみると・・・ 書き方 実行結果 得点:83 得点:73 得点:63 得点:83 得点:93 得点:75
あるモノの中にそれと同じモノを入れた構造 繰り返し処理で使用している変数のす べての組み合わせが実行される ※カンマ演算子を使うと for文で複数の変数を同時に変化も可能
while文 ( )の中に記述した条件式がtrueを返す間、繰り返し処理が行われる for文︰指定した回数だけ繰り返し処理が行われる while文︰指定した条件が満たされなくなるまで、回数に宣言なく繰り返し処理が行われる for文とは違い、初期化式や変化式がいらない ※繰り返し実行する文が 1つだけの場合、ブ ロック {
} を省略できる while(条件式) 実行文;
do…while文 while文と似ているが・・・ while文︰最初に条件式し、場合によっては 1回も繰り返し処理が行われないこともある do…while文︰繰り返し処理を行ってから条件式の評価を行う、つまり必ず 1回は繰り返し処理が行わ れる ※繰り返し実行する文が 1つだけの場合、ブ ロック
{ } を省略できる do 実行する文 while(条件式);
object型 object {age: 23} 複数のプロパティとメソッドを持つことが できるデータ型 { }の中にプロパティ名とその型を列挙する 型定義の部分でinterfaceを使う