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
僕とprototypeとJSONで / Me and prototype down by th...
Search
Edward Fox
December 20, 2018
Technology
0
130
僕とprototypeとJSONで / Me and prototype down by the JSON
2018/12/20 We Are JavaScripters! @27th
https://wajs.connpass.com/event/111736/
Edward Fox
December 20, 2018
Tweet
Share
More Decks by Edward Fox
See All by Edward Fox
Priorityを制するものはローディングを制す
edwardkenfox
4
680
Lambda@Edgeを利用したサードパーティJavaScriptのカナリアリリース / Canary release using Lamdba@Edge
edwardkenfox
0
87
AWS re:Invent 2019 / Hackathon for Good 参加録
edwardkenfox
2
560
Repro basketball club
edwardkenfox
0
230
Introduction to UX Optimizer
edwardkenfox
0
95
フロントエンド開発の落とし穴 / Fallacies of Client Side Programming (2019ver)
edwardkenfox
0
300
クライアントサイド開発の落とし穴 / Fallacies of Client Side Programming
edwardkenfox
0
420
Beacon API ことはじめ 〜そしてkeepalive fetchへ〜 / Beacon API The Basics
edwardkenfox
0
1.1k
window.windowとは何か / What is window window
edwardkenfox
1
210
Other Decks in Technology
See All in Technology
Node−RED で Ollama を使ったローカルLLM(node-red-contrib-ollamaを利用) / ビジュアルプログラミングIoTLT vol.20
you
PRO
0
140
セキュリティSaaS企業が実践するCursor運用ルールと知見 / How a Security SaaS Company Runs Cursor: Rules & Insights
tetsuzawa
0
270
大手企業のAIツール導入の壁を越えて:サイバーエージェントのCursor活用戦略
gunta
9
1.4k
JNation 2025 - Quarkus for Spring Developers
edeandrea
PRO
0
110
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
12k
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
740
Oracle Database オプティマイザ・ヒントの活用
oracle4engineer
PRO
1
140
ローカル環境でAIを動かそう!
falken
PRO
1
170
“新卒らしさ”を脱ぎ捨てて 〜1年を経て学んだこと〜
rebase_engineering
0
130
MCP Clientを活用するための設計と実装上の工夫
yudai00
1
790
TechBull Membersの開発進捗どうですか!?
rvirus0817
0
140
OTel meets Wasm: プラグイン機構としてのWebAssemblyから見る次世代のObservability
lycorptech_jp
PRO
1
300
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
Unsuck your backbone
ammeep
671
58k
Mobile First: as difficult as doing things right
swwweet
223
9.6k
Designing for humans not robots
tammielis
253
25k
Stop Working from a Prison Cell
hatefulcrawdad
269
20k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
34
2.3k
Fireside Chat
paigeccino
37
3.5k
Faster Mobile Websites
deanohume
307
31k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
106
19k
Rails Girls Zürich Keynote
gr2m
94
13k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Transcript
ͱprototypeͱJSONͰ Edward Fox 2018/12/20 @We Are JavaScripters! #27
@edwardkenfox Edward Fox ɾWEBΤϯδχΞ @ Reproגࣜձࣾ ɾWEBʗϒϥβٕज़શൠɺPWA ɾΫϥϑτϏʔϧɺԻָɺόεέ
https://pmctvline2.files.wordpress.com/2014/04/friday-the-13th-dw.jpg ࠓJSONͷා͍͠·͢ ʢ࣮Ͱ͢ʣ
ීஈͷۀ = ReproͷWeb SDKͷ։ൃ + อक = ৭ʑͳαΠτͰಈ͘ίʔυΛॻ͘
৭ʑͳαΠτͰಈ͘ ίʔυΛॻ͍͍ͯΔͱ ࣌ʹحոͳ໘ʹૺ۰͠·͢
ͱΓ͋͑ͣݟ͍ͯͩ͘͞
2008ʹ։ઃ͞Εͨ ϑΝογϣϯܥECαΠτ
ΠέͯΔαΠτ ΠέͯΔϑϨʔϜϫʔΫΛ͏
2008࣌࠷ΠέͯΔ ϑϨʔϜϫʔΫ = prototype.js ʢҟೝΊ·͢ʣ
http://prototypejs.org
ΦϒδΣΫτͷϓϩτλΠϓʹ উखʹ ྑ͍ײ͡ʹؔΛੜͯ͠ ྑ͍ײ͡ͷAPIΛఏڙͯ͘͠ΕΔ
͡Ό͋Ұମ prototype.js ͕ ͳʹΛͨͬͯ͠ݴ͏Μͩʂ
͜͜ͰҰ୴ JSONͷ༷ΛݟͯΈ·͠ΐ͏
https://www.ecma-international.org/ecma-262/5.1/
https://www.ecma-international.org/ecma-262/5.1/#sec-15.12.3
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify > If the value has a toJSON() method, it's
responsible to define what data will be serialized.
Α͏͢Δʹ
JSONͷதͰvalueͱͳ͍ͬͯΔ ΦϒδΣΫτʹ toJSON ͱ͍͏ ͕ؔੜ͑ͯΕ ͦΕΛͬͯγϦΞϥΠζ͢Δ
prototype.js ʹͬͯݟͯΈΔͱ
Array.prototype ʹ ຊདྷଘࡏ͠ͳ͍ toJSONΛੜ͍ͯ͠Δʂ
͔͠ όάͬͯΔʂ
ͦͯ͠ ͏ͪͷJS͕ר͖ࠐ·ΕΔʂ⚰⚰⚰
ແࣄࢮ
None
※ 1.6.0.3 (= 2008ࠒ) લޙͷ όʔδϣϯͰ͔͠ى͖ͳ͍Ͱ͢
མͪண͍ͯݕূ
None
ਖ਼ৗಈ࡞
None
!?
ೋॏʹจࣈྻԽ
None
Array ʹ toJSON Λੜ͢ͱ ݁ՌΛ্ॻ͖Ͱ͖ͨʂ
ා͍ɺ https://www.youtube.com/watch?v=qozKDT5bYlA
WE ARE HIRING!
i
Fin