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
PHPerから見た昨今のJSについて
Search
polidog
March 14, 2015
Technology
500
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PHPerから見た昨今のJSについて
polidog
March 14, 2015
More Decks by polidog
See All by polidog
omasushiというライブラリを作った
polidog
0
600
RelayerというPHPのフレームワークを作った
polidog
0
220
AIがコードを書く時代の ジェネレーティブプログラミング
polidog
3
1.4k
小さな開発会社を作った理由(再)
polidog
0
330
React Server ComponentsでAPI不要の開発体験
polidog
1
980
小さな開発会社が受託開発に力を入れる理由
polidog
0
590
小さな開発会社を作った理由
polidog
1
3.8k
小さな開発会社がWebサービスを作る理由
polidog
1
900
トランザクションスクリプトは何がダメなのか?
polidog
2
4.1k
Other Decks in Technology
See All in Technology
専門領域のAIをどう評価するか
bengo4com
2
270
しろおびから始める!ログ活用の第一歩
shumei_ito
0
950
JAWSUG TOHOKU 青森支部 「LoGoチャット」のAWS移行で 乗り越えたこと
taketakekaho
0
340
二歩目のフロントエンド・ウェブアクセシビリティ
camiha
2
650
[JAWS-UG彩の国埼玉#12]そろそろ準備する?re:Invent2026をやさしく解説 / reinvent2026-sainokuni
sh_fk2
1
350
1つのリクエストを追って理解する - llm-dのP/D分離
akhino
1
160
S3 Filesで挑む! 八戸せんべい汁の食べ頃問題
usanchuu
0
110
20261017福岡devIO 「AIは"良いダッシュボード"を作れるか?
jtakeda
0
180
DGX Spark でどこまでハッキングができるのか?
kash1064
3
1.4k
QA4AI 2026-Oct 生成AI時代の品質保証
tokuty
1
890
Browser Spec: Testing Hotwire with Ruby
takahashim
1
130
自作バイナリを動かす「入口」8選
puhitaku
2
1.3k
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
203
77k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
400
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
How to Talk to Developers About Accessibility
jct
2
580
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
710
Scaling GitHub
holman
464
140k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
300
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
580
Transcript
PHPer͔ΒݟͨࡢࠓͷJSʹͭ ͍ͯ ੩ԬJavaScriptษڧձ #3 @polidog
ࣗݾհ • ϙϦυοάͰ͢ɻ݄ྋଠͬͯݴ͍·͢ɻ • ਗ਼ਫࢢੜ·Εɻਗ਼ਫ۠ҭͪɻ • PHPerͰ͢ɻJS࣌ʑॻ͖·͢ɻ • SymfonyϢʔβʔձͷਓʹͳΓ·ͨ͠ɻ •
λϰΟίϜגࣜձࣾͰΤϯδχΞͬͯ·͢ɻ
ࠓ͍ͨ͜͠ͱ
ͦͷલʹએ
λϰΟίϜͰɺgotripͱ͍ ͏ϝσΟΞͬͯ·͢ɻ http://gotrip.jp/
Symfony Meetup։࠵͠· ͢ʂ https://symfony.doorkeeper.jp/events/ 21692
ࠓ͍ͨ͜͠ͱ
ECMA Script6!!
– @nakajmg “ࠓ͔Β֮͑ΔͳΒCoffeeScriptΑΓES6 ͩΑɻ”
ͱ͜ΖͰESͬͯʁ
–ɹWikipediaΑΓ “Ecma InternationalʹΑͬͯඪ४Խ͞Ε ͨεΫϦϓτݴޠͰ͋Δɻ࣮͝ͱͷޓ ੑ͕͍ JavaScript ྨʢಛʹ JScriptʣ ͷඪ४ΛఆΊͨͷͰ͋Δɻ”
ES6ͰՃ͞ΕΔ
Features https://github.com/lukehoban/es6features
ࠓ͢ػೳ 1. ؔ(Arrow functions,Function Argumentss) 2. ม(let + const) 3.
Ϋϥε(classes) 4. δΣωϨʔλͱfor of 5. άϩʔόϧΦϒδΣΫτ(Map,Set, WeakMap, WeakSet) 6. Promises
1. ؔ var test = a => { console.log(“execute!! :
”+a); } function a(x, y=12) { } function b(x, ...y) { } function c(x,y,z) {} args = [1,2,3] c(…args);
1. ؔ(ArrowFunctions) =>ΛͬͯؔఆٛͰ͖Δ Ҿෳ (a,b) => ͱͳΔ ෳߦͷ߹{}Λ͏
1. ؔ(FunctionArguments) ؔύϥϝʔλʹʹσϑΥϧτ͕ઃఆͰ͖ Δɻ ՄมҾΛ…argsͰࢦఆͰ͖Δɻ ྻΛؔҾʹల։Ͱ͖Δɻ
2. ม let hoge = 1; const fuga = 2;
2. ม letΛ͏ͱϒϩοΫείʔϓ͕࣮ݱͰ͖Δɻ constΛ͏ͱ্ॻ͖Ͱ͖ͳ͍ɻ
3. Ϋϥε class Hoge { } var hoge = new
Hoge();
3. Ϋϥε ΫϥεએݴͰॻ͚Δɻ extendsͰܧঝͰ͖Δɻ superͰܧঝݩͷϝιουݺͼग़ͤΔɻ
4. δΣωϨʔλͱfor of let gen = function*() { for(let i
= 0; i < 10; i++) { yield i+10; } } for (let i of gen()) { console.log(i) }
4. δΣωϨʔλͱfor of function* ͱ yieldΛ͏ for of ͰϧʔϓͰ͖Δ ArrowFunctionͱΈ߹ΘͤΒΕͳ͍
5. άϩʔόϧΦϒδΣΫτ var set = new Set(); set.add(“hoge”).add(“fuga”) var map
= new Map(); map.set(“hoge”,10); map.set(“fuga”,20);
5. άϩʔόϧΦϒδΣΫτ Set Map WeakSet WeakMap ͕͑Δɻ
6. Promises function timeout(duration = 0) { return new Promise((resolve,
reject) => { setTimeout(resolve, duration); }) } var p = timeout(1000).then(() => { return timeout(2000); }).then(() => { throw new Error("hmm"); }).catch(err => { return Promise.all([timeout(100), timeout(200)]); })
6. Promises http://azu.github.io/promises-book/
Ͳ͏ͬͯಈ͔͢ͷʁ
ECMAScript 6 compatibility table http://kangax.github.io/compat-table/es6/
େ͖͚ͯ̎ͭ͘ • αʔόαΠυͰ࣮ߦ͢Δ • τϥϯείϯύΠϥΛར༻͢Δ
αʔόαΠυͰಈ͔ͯ͠ΈΑ ͏ɻ
IUUQTJPKTPSHKBJOEFYIUNM
͜Μͳײ͡Ͱ࣮ߦ͢Δ $ iojs --harmony_classes ./classes.es6.js $ iojs --harmony_arrow_functions ./arrows.js $
iojs --es_staging ./hoge.js
iojs͏ͱ͖ʹҙ
Φϓγϣϯ(flag)͕ඞཁ • shipping features → ϑϥάඞཁͳ͍ • staged features →
--es_staging͕ඞཁ • in progress features → ݸผʹϑϥάࢦఆ͕ඞ ཁ
ϑϥάΛௐΔ $ iojs --v8-options | grep harmony
ΊΜͲ͍͔͘͞Βશ෦ͷϑϥ άΛࢦఆͯ͠ΈΔɻ $ iojs $(iojs --v8-options | grep harmony |
sed -e 's/(.*)\(.* \)/ /g' | tr '\n' ' ‘) ./hoge.js
ৄ͍͠ࣄiojsͷαΠτͷ͜ ͜Λ֬ೝ͠·͠ΐ͏ɻ https://iojs.org/ja/es6.html
τϥϯείϯύΠϥ
IUUQTCBCFMKTJP
gulpͱΈ߹ΘͤͯΈ·͠ΐ ͏ɻ
“Ұ൪ॏཁͳͷָ͘͠ॻ͚Δ͔Ͳ͏͔ͬ ͯ͜ͱɻ”