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
Scaffold for Read and Debug JavaScript
Search
Koji Saiki
September 24, 2019
Programming
0
77
Scaffold for Read and Debug JavaScript
Introduction information for javascript rookie, reader, debugger, javascript product supporter
Koji Saiki
September 24, 2019
Tweet
Share
More Decks by Koji Saiki
See All by Koji Saiki
Angular で PCF した話
kojisaiki
0
540
Why is the subject of the story about Java support JDK?
kojisaiki
0
120
いまどきのSIer的品質向上
kojisaiki
0
150
誰も教えてくれなかったSEとしてただ一つ必要なこと
kojisaiki
0
440
真・なぜ誰もこう書いてくれないDependency Injection入門
kojisaiki
0
770
なぜ誰もこう書いてくれない Dependency Injection
kojisaiki
5
1.8k
Other Decks in Programming
See All in Programming
実践Claude Code:20の失敗から学ぶAIペアプログラミング
takedatakashi
18
8.3k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
610
Go言語はstack overflowの夢を見るか?
logica0419
0
520
Android16 Migration Stories ~Building a Pattern for Android OS upgrades~
reoandroider
0
130
AI 駆動開発におけるコミュニティと AWS CDK の価値
konokenj
5
220
When Dependencies Fail: Building Antifragile Applications in a Fragile World
selcukusta
0
110
SwiftDataを使って10万件のデータを読み書きする
akidon0000
0
240
Devvox Belgium - Agentic AI Patterns
kdubois
1
140
CSC509 Lecture 07
javiergs
PRO
0
240
Google Opalで使える37のライブラリ
mickey_kubo
3
140
バッチ処理を「状態の記録」から「事実の記録」へ
panda728
PRO
0
190
Devoxx BE - Local Development in the AI Era
kdubois
0
140
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
411
23k
A Tale of Four Properties
chriscoyier
161
23k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Leading Effective Engineering Teams in the AI Era
addyosmani
7
600
How GitHub (no longer) Works
holman
315
140k
Designing Experiences People Love
moore
142
24k
RailsConf 2023
tenderlove
30
1.3k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
How STYLIGHT went responsive
nonsquared
100
5.8k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.1k
Being A Developer After 40
akosma
91
590k
The Language of Interfaces
destraynor
162
25k
Transcript
Scaffold for Read and Debug JavaScript KOJI SAIKI@SAIKOU9901 2019/09/24
Who am I ? 佐伯紘二(サイキ コウジ) Now: Support Engineer@Microsoft for
Dynamics C&E / PowerApps / Flow Old: Application Engineer with Typescript / Java etc. Twitter: @saikou9901 Github: @kojisaiki
Preface 社内のサポートエンジニア仲間向けの勉強会資料を公開用に調整したものです。 JavaScript を読んだりデバッグしたりする際に参考になれば。 特に大切な内容は↓マーク。
Line-up Background Use Case How JS Works Tips
Background 技術背景
Netscape で誕生 1995 年に Netscape Communications の Brendan Eich が開発した。
1996 年に Internet Explorer 3.0 に搭載された後、普及率アップ。
Java とは技術的な関係なし Java が当時流行っていた。 Sun Microsystems と Netscape Communications が業務提携していた。
JSは「実装」。「仕様」は “ECMAScript” 標準仕様は “ECMAScript” (エクマスクリプト)。実装ごとに独自拡張がある。 開発者 Brendan Eich を中心とした標準化団体 Ecma
International がメンテナンスしている。 http://ecma-international.org/
Use Case どのように 使用されているか
WEBページにアクションをつける HTML は文書構造、 CSS は Look and Feel 、 JavaScript
は Action (Behavior) を定義する。
Node.js によるサーバサイド開発 2009 年に Ryan Dahl により開発された。
普及により汎用スクリプト言語化 モバイルネイティブアプリや、Unityによるゲーム開発も行われる。
TypeScriptによりさらに使いやすく Microsoft が 2012 年に公開した TypeScript は JavaScript へのトランスパイル言語。 型推論などにより開発が超便利に。
How JS Works どうやって 動いてるのか
JavaScriptのエンジン ブラウザごとに JavaScript エンジンが搭載されている。
エンジンがスクリプトを順番に実行 スクリプトの上から順番に実行される。 「巻上げ」という特殊な仕様があり、 関数宣言は後ろに書いてもOK。 https://developer.mozilla.org/ja/docs/Web /JavaScript/Reference/Statements/functio n#Function_declaration_hoisting
イベントによる処理実行 よくある OnClick や OnSubmit はこれ。 Event は ECMAScript ではなく、W3C
の DOM Standardでインタフェースだ け決まっている。 https://www.w3.org/TR/domcore/ ブラウザ間の互換性問題はこの辺で よく起きる。
Tips JSを捌くための
リファレンスは Mozilla でおk 仕様はとにかくこのサイト。ブラウザごとの取り扱いや ECMAScript 対応表もある。 https://developer.mozilla.org/ja/docs/Web/JavaScript
動作見るなら F12 のコンソール コンソールでスクリプトを試せる。 ウィンドウごとにエンジンが動いているので、変数宣言範囲はウィンドウごと。
特殊な値 null, undefined, NaN null: プロパティが宣言されているが、値なし。 undefined: プロパティの宣言なし。 NaN: 数値に変換できなかった結果。この値は
Number 型にしか出現しない。
HTMLで宣言=実行開始 HTMLで読み込み宣言される箇所でスクリプ トが実行される。 HTMLのロードが途中で止まっている場合は、 その直前のスクリプトを疑う。 JS ファイルのロードを body 末尾にするという プラクティスがある。
https://allabout.co.jp/gm/gc/380498/2/
とにかくシングルスレッド setTimeout 等はタスクキューに詰める。処理が終わらないと次のタスクは処理されない。 https://qiita.com/Kikulin/items/3e980d00102c5c7cf600
Line-up Background Use Case How JS Works Tips
Thank you! References: https://ja.wikipedia.org/wiki/JavaScript https://github.com/tc39/ecma262 https://dom.spec.whatwg.org/ https://developer.mozilla.org/ja/docs/Web https://allabout.co.jp/gm/gc/380498/2/ https://christina04.hatenablog.com/entry/2017/03/13/190000 https://qiita.com/Kikulin/items/3e980d00102c5c7cf600