Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
僕とprototypeとJSONで / Me and prototype down by the JSON
Edward Fox
December 20, 2018
Technology
0
85
僕と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
[email protected]
を利用したサードパーティJavaScriptのカナリアリリース / Canary release using
[email protected]
edwardkenfox
0
34
AWS re:Invent 2019 / Hackathon for Good 参加録
edwardkenfox
2
340
Repro basketball club
edwardkenfox
0
100
Introduction to UX Optimizer
edwardkenfox
0
50
フロントエンド開発の落とし穴 / Fallacies of Client Side Programming (2019ver)
edwardkenfox
0
190
クライアントサイド開発の落とし穴 / Fallacies of Client Side Programming
edwardkenfox
0
240
Beacon API ことはじめ 〜そしてkeepalive fetchへ〜 / Beacon API The Basics
edwardkenfox
0
820
window.windowとは何か / What is window window
edwardkenfox
1
150
Post-Evolution state of the web
edwardkenfox
2
1.1k
Other Decks in Technology
See All in Technology
re:Invent re:Cap / AWS Lambda Updates
bulbulpaul
1
140
JAWS-UG AI/ML #15 - SageMaker Experimentsで始める機械学習モデルの実験管理
masatakashiwagi
0
300
ステート管理を超えるRecoil運用の考え方
uhyo
7
5k
Amazon Forecast を使って売上予測をしてみた
tomuro
0
290
Exploring MapStore Release 2022.02: improved 3DTiles support and more
simboss
PRO
0
150
チケットNFTの仕組み
sbtechnight
0
320
Dev Containers ことはじめ - 失敗から学ぶ開発環境運用法
streamwest1629
0
230
2年で10→70人へ! スタートアップの 情報セキュリティ課題と施策
miekobayashi
1
170
Janus
bkuhlmann
0
120
【NGK2023S】 ノードエディタ形式の画像処理ツール「Image-Processing-Node-Editor」
kazuhitotakahashi
0
180
lt53
98_justdoit
0
110
Airdrop for Open Source Projects
epicsdao
0
200
Featured
See All Featured
Bash Introduction
62gerente
601
210k
Gamification - CAS2011
davidbonilla
75
4.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
317
22k
Build your cross-platform service in a week with App Engine
jlugia
221
17k
Raft: Consensus for Rubyists
vanstee
130
5.7k
10 Git Anti Patterns You Should be Aware of
lemiorhan
643
54k
jQuery: Nuts, Bolts and Bling
dougneiner
57
6.6k
Building Flexible Design Systems
yeseniaperezcruz
314
35k
Put a Button on it: Removing Barriers to Going Fast.
kastner
56
2.5k
Why You Should Never Use an ORM
jnunemaker
PRO
49
7.9k
Navigating Team Friction
lara
176
12k
Optimizing for Happiness
mojombo
365
64k
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