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
Java エンジニアのためのJavaScript講座
Search
Takeshi Kawajiri
April 24, 2013
Technology
4
1.2k
Java エンジニアのためのJavaScript講座
JJUG Night Seminar.
http://kokucheese.com/event/index/85227/
Takeshi Kawajiri
April 24, 2013
Tweet
Share
Other Decks in Technology
See All in Technology
アジャイルチームが変化し続けるための組織文化とマネジメント・アプローチ / Agile management that enables ever-changing teams
kakehashi
2
2.5k
デジタルアイデンティティ技術 認可・ID連携・認証 応用 / 20250114-OIDF-J-EduWG-TechSWG
oidfj
2
250
Google Cloud で始める Cloud Run 〜AWSとの比較と実例デモで解説〜
risatube
PRO
0
140
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
26
7.1k
20241218_マルチアカウント環境におけるIAM_Access_Analyzerによる権限管理.pdf
nrinetcom
PRO
3
150
12 Days of OpenAIから読み解く、生成AI 2025年のトレンド
shunsukeono_am
0
1k
生成AIによるテスト設計支援プロセスの構築とプロセス内のボトルネック解消の取り組み / 20241220 Suguru Ishii
shift_evolve
0
180
Alignment and Autonomy in Cybozu - 300人の開発組織でアラインメントと自律性を両立させるアジャイルな組織運営 / RSGT2025
ama_ch
1
1.7k
スケールし続ける事業とサービスを支える組織とアーキテクチャの生き残り戦略 / The survival strategy for Money Forward’s engineering.
moneyforward
0
240
動画配信の フロントエンドを支える 4年間とこれから
nisshii0313
0
110
20241228 - 成為最強魔法使!AI 實時生成比賽的策略 @ 2024 SD AI 年會
dpys
0
340
3年でバックエンドエンジニアが5倍に増えても破綻しなかったアーキテクチャ そして、これから / Software architecture that scales even with a 5x increase in backend engineers in 3 years
euglena1215
11
4.3k
Featured
See All Featured
Producing Creativity
orderedlist
PRO
343
39k
Facilitating Awesome Meetings
lara
50
6.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
The Invisible Side of Design
smashingmag
299
50k
GitHub's CSS Performance
jonrohan
1030
460k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
RailsConf 2023
tenderlove
29
960
Statistics for Hackers
jakevdp
797
220k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.4k
Adopting Sorbet at Scale
ufuk
74
9.1k
Docker and Python
trallard
43
3.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Transcript
݄ !L[SJ ++6(φΠτɾηϛφʔ ʮ+BWBΤϯδχΞͷͨΊͷ+BWB4DSJQUߨ࠲ʯ ໊ࢺԦࠃͱͭͷଜͷ
৲߶ 4*
/&8
"MMZPVSCBTFBSFCFMPOHUPVT
ετΞΞϓϦ
None
None
None
+BWB4DSJQU ։ൃऀͷڞ௨ݴޠ
ΩʔϝοηʔδΛதԝʹදࣔ ϑΥϯτ ώϥΪϊ֯ΰ4UE/QU +BWB4DSJQUͷॻ੶ʹৄ͍͠ େઌੜ ૉࡐ ࠓ
None
+BWBͷ ઓ࢜ 1SPHSBNNFS ຐ๏͍ )BDLFS ૐཿ 2"
ಈࢺଜ ໊ࢺଜ ϥϜμଜ
Ճ(ᣀ, 105); ͢_ϖΫνϯ(ᣀ); ࠞͥΔ(ϨϞϯ, ᣀ); ಈࢺଜ
໊ࢺଜ new ು; ು.͢(ᣀ); ು.Ճ(105); ು.͢(ϖΫνϯ);
ϥϜμଜ $(ᣀ).Ճ(λ{ Թ < 105 }).ࠞͥΔ(ϖΫνϯ, λ{ Ώͬ͘Γͱ }).ࠞͥΔ(...
ಈࢺଜ ໊ࢺଜ ϥϜμଜ
ຊͷΰʔϧ
wΞδΣϯμ w։ൃڥ wجຊͱΦϒδΣΫτ wධՁͱ࣮ߦ wϓϩτλΠϓνΣʔϯ wUIJTଋറ wείʔϓνΣʔϯ
ݥͷ४උ
None
None
ຊؾʹͳͬͨΒ
None
None
None
None
None
None
ϞμϯΛࣹఔڑʹஔ͘
ಈࢺଜ
var a = 1; function func(b) { return a +
b; } func(10); //=> 11
var a = 1; function func(b) { return a +
b; } func(10); //=> 11 มએݴ
var a = 1; function func(b) { return a +
b; } func(10); //=> 11 ؔએݴ
var a = 1; function func(b) { return a +
b; } func(10); //=> 11 Ҿ ฦΓ
var a = 1; function func(b) { return a +
b; } func(10); //=> 11 ֎෦มͷࢀর
var a = 1; function func(b) { return a +
b; } func(10); //=> 11 ؔݺͼग़͠
var a = 1; function func(b) { return a +
b; } func(10); //=> 11 ࣝผࢠ
var a = 1; function func(b) { return a +
b; } func(10); //=> 11
ϓϦϛςΟϒ ͱ ΦϒδΣΫτ
ͱ OFX/VNCFS
B ͱ OFX4USJOH B
۠ผͰ͖ͳ͍ ͱ ۠ผͰ͖Δ
ͱ OFX/VNCFS OFX/VNCFS
Λ͢ ͱ ࢀরΛ͢
WBSBC ͱ WBSBC OFX/VNCFS
୯Ұͷ ͱ ঢ়ଶΛ࣋ͭ
var n = new Number(1); n["prop1"] = 1; n["prop1"]; //=>
1 n.prop2 = 2; n.prop2; //=>2 Ç QSPQ O QSPQ
ϓϦϛςΟϒ ΦϒδΣΫτ ൺֱ ಉੑ ಉҰੑ ೖ ࢀর ঢ়ଶͷอ࣋ ʷ
˓
wϓϦϛςΟϒ ‣ /B/ ‣จࣈྻ B BC
‣ਅِ USVF GBMTF ‣OVMM ‣VOEFpOFE
wΦϒδΣΫτ ‣0CKFDU ‣"SSBZ ‣/VNCFS ‣4USJOH ‣#PPMFBO ‣'VODUJPOͳͲ
wΦϒδΣΫτ ‣0CKFDU ‣"SSBZ ‣/VNCFS ‣4USJOH ‣#PPMFBO ‣'VODUJPOͳͲ
var obj = new Object; obj.a = 1; obj.a; //=>
1 var obj = { a: 1 }; obj.a; //=>1
var arr = new Array; arr[0] = 1; arr[0]; //=>
1 var arr = [1, 2]; arr[0]; //=> 1
var arr = [1, 2]; arr[100] = 3; arr.a =
1; BSS B
wΦϒδΣΫτ ‣0CKFDU ‣"SSBZ ‣/VNCFS ‣4USJOH ‣#PPMFBO ‣'VODUJPOͳͲ
new Number(1) + new Number(2); //=> 3
(1).a = 1; (1).a; //=> undefined; (new Number(1)).a = 1;
(new Number(1)).a; //=> undefined
wΦϒδΣΫτ ‣0CKFDU ‣"SSBZ ‣/VNCFS ‣4USJOH ‣#PPMFBO ‣'VODUJPOͳͲ
function a(){} var b = a; b(); var c =
function() { }; c();
var obj = { m: function(a) { return a +
1; } }; obj.m(1); //=> 2
ධՁͱ࣮ߦ
var a, b = 1; a = 2; function c(d)
{ var e = 5; } c(2);
var a, b = 1; a = 2; function c(d)
{ var e = 5; } c(2);
a(); function a(){} b(); //ERROR var b = function(){};
TDSJQU IUNM
var a, b = 1; a = 2; function c(d)
{ var e = 5; } c(2);
var a = 1; function f1() { var b =
2; function f2() { var c = 3; }; }
if(false) { var a = 1; } for(var i=0; i<3;
i++) { }
໊ࢺଜ
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1(10); //=> 12
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1(10); //=> 12 OFXࣜ
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1(10); //=> 12 ίϯετϥΫλ
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1(10); //=> 12 Πϯελϯε
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1(10); //=> 12 ϓϩτλΠϓ
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1(10); //=> 12 ϝιου
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1(10); //=> 12
.Z OFX ίϯετϥΫλ Πϯελϯε B
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1(10); //=> 12
N .Z OFX ίϯετϥΫλ ϓϩτλΠϓ Πϯελϯε ҕৡ QSPUPUZQF B
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1(10); //=> 12 OFX0CKFDU
N .Z OFX ίϯετϥΫλ ϓϩτλΠϓ Πϯελϯε ҕৡ QSPUPUZQF UP4USJOH 0CKFDU
ҕৡ ϓϩτλΠϓ ίϯετϥΫλ OFX QSPUPUZQF B
N .Z OFX ίϯετϥΫλ ϓϩτλΠϓ Πϯελϯε ҕৡ QSPUPUZQF B $MBTT
w+BWBͰͷΫϥε ˒ςϯϓϨʔτ ˒ڇ ˒֓೦
w+BWBͰͷΫϥε ˒ςϯϓϨʔτ ˒ڇ ˒֓೦
ςϯϓϨʔτ ͨ͜ম͖ͷܕ ઃܭॻ ܗ Original Update by Will Scullin
Ϋϥεͬͯखஈʁ Original Update by Will Scullin
Original Update by Keith Williamson
Original Update by Keith rfranklinaz
ςϯϓϨʔτ ͨ͜ম͖ͷܕ ઃܭॻ ܗ Original Update by Will Scullin
Ϋϥεͬͯܕʁ Original Update by Will Scullin
Original Update by Leo-setä
var my = new My(1); my.m2 = function() { };
my.m2();
w+BWBͰͷΫϥε ˒ςϯϓϨʔτ ˒ڇ ˒֓೦
Original Update by admiller ݘ͕ϫϯϫϯ ڇ͕ϞʔϞʔ ೣ͕χϟʔ
Original Update by admiller Ϋϥεͬͯෆมʁ
$("#div_id") .toggleClass('oldClass newClass');
4* 3VCZJTU ͓̽͡͞ ߨࢣ ͓͞Μ /&8
ޱ࠲ Original Update by Dirk_Vorderstraße
var n = new Number(1); n instanceof Number; //=> true
n.__proto__ = String.prototype n instanceof Number; //=> false n instanceof String; //=> true
Original Update by admiller Ϋϥεͬͯ ඞਢʁ
ԿऀʹͳΕͳ͍ ΦϒδΣΫτ
Object.prototype instanceof Object; //=> false Object.create(null) instanceof Object; //=> false
w+BWBͰͷΫϥε ˒ςϯϓϨʔτ ˒ڇ ˒֓೦
Original Update by Keith jodelli ֓೦ͱ࣮ମ ΠσΞͱ࣮ࡏ ʮBQQMFʯͱʮBOBQQMFʯ
"QQMF OFX Ϋϥεఆٛ Πϯελϯε ιʔείʔυ ΠσΞ ϝϞϦ ݱ࣮ BQQMF
Apple? "QQMF OFX Ϋϥεఆٛ ΫϥεΦϒδΣΫτ Πϯελϯε DMBTT ιʔείʔυ ֓೦ ϝϞϦ
ݱ࣮ BQQMF
Apple? "QQMF OFX Ϋϥεఆٛ ΫϥεΦϒδΣΫτ Πϯελϯε DMBTT ιʔείʔυ ֓೦ ϝϞϦ
ݱ࣮ BQQMF $MBTT
N .Z OFX ίϯετϥΫλ ϓϩτλΠϓ Πϯελϯε ҕৡ QSPUPUZQF B $MBTT
N .Z OFX ίϯετϥΫλ ϓϩτλΠϓ Πϯελϯε ҕৡ QSPUPUZQF B
0CKFDU
0CKFDU $MBTT
Original Update by Keith Williamson
Original Update by Keith rfranklinaz
0CKFDU $MBTT
$("#div_id") .toggleClass('oldClass newClass');
&MFNFOU $MBTT
Apple? "QQMF OFX Ϋϥεఆٛ ΫϥεΦϒδΣΫτ Πϯελϯε DMBTT ιʔείʔυ ֓೦ ϝϞϦ
ݱ࣮ BQQMF
0CKFDU $MBTT
Original Update by Leo-setä
0CKFDUϓϩτλΠϓ 0CKFDUΠϯελϯε
var n = new Number(1); n instanceof Number; //=> true
n.__proto__ = String.prototype n instanceof Number; //=> false n instanceof String; //=> true
Object.prototype instanceof Object; //=> false Object.create(null) instanceof Object; //=> false
0CKFDUϓϩτλΠϓ ܧঝΦϒδΣΫτ .ZϓϩτλΠϓ
0CKFDUϓϩτλΠϓ 0CKFDUΠϯελϯε .ZϓϩτλΠϓ .ZΠϯελϯε
Object prototype prototype obj2 new MyClass my1 my2
.Z Ϋϥεఆٛ Πϯελϯε DMBTT ιʔείʔυ ֓೦ ϝϞϦ ݱ࣮ BQQMF 0CKFDU
Ϋϥεఆٛ DMBTT நઢ ܧঝઢ $MBTT$MBTT
N ҕৡઢ ϓϩτλΠϓ Πϯελϯε UP4USJOH ϓϩτλΠϓ B 'VODUJPOϓϩτλΠϓ .Z 0CKFDU
.Z Ϋϥεఆٛ Πϯελϯε DMBTT ιʔείʔυ ֓೦ ϝϞϦ ݱ࣮ BQQMF 0CKFDU
Ϋϥεఆٛ DMBTT நઢ ܧঝઢ $MBTT$MBTT
.Z Ϋϥεఆٛ Πϯελϯε DMBTT ιʔείʔυ ֓೦ ϝϞϦ ݱ࣮ BQQMF 0CKFDU
Ϋϥεఆٛ DMBTT நઢ ܧঝઢ $MBTT$MBTT
N ҕৡઢ ϓϩτλΠϓ Πϯελϯε UP4USJOH ϓϩτλΠϓ B 'VODUJPOϓϩτλΠϓ .Z 0CKFDU
N ҕৡઢ ϓϩτλΠϓ Πϯελϯε UP4USJOH ϓϩτλΠϓ B 'VODUJPOϓϩτλΠϓ .Z 0CKFDU
UIJTࢀর
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1(10); //=> 12
B N 0CKFDU
N B B N
N B B N
ؔ Ҿ ฦΓ ҾϦετ ؔຊମ
ؔ Ҿ ฦΓ UIJTҾ ڥ
a.b(); a.b<<a>>(); a.b.c(); a.b.c<<b>>();
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1<<my>>(10); //=> 12
ͲΜͳUIJTม͑Δ ࠷ڧͷໃ 'VODUJPODBMM
function func(b) { this.a; } func.call({a:1}, 10);
function func(b) { this.a; } func.call({a:1}, 10);
ͲΜͳࢦఆ͔ΒकΔ ࠷ڧͷ६ 'VODUJPOCJOE
function func(b) { this.a; } func.bind({a:1})(10);
function func(b) { this.a; } func.bind({a:1})(10);
function func(b) { this.a; } func.bind({a:1})(10);
func.bind({a:1}) .call({a:2}); ΄͜ʷͨͯ 'JHIU
function MyUI($el, a) { this.a = a; $el.click(this.m); } MyUI.prototype.m
= function(){ this.a };
function MyUI($el, a) { this.a = a; $el.click(this.m); } MyUI.prototype.m
= function(){ this.a };
function MyUI($el, a) { this.a = a; $el.click(this.m); } MyUI.prototype.m
= function(){ this.a };
function MyUI($el, a) { this.a = a; $el.click(this.m.bind(this)); } MyUI.prototype.m
= function(){ this.a };
ؔ Ҿ ฦΓ UIJTҾ ڥ UIJT
func.call(undefined); func.call(null); func.call(1); func.call(“a”); func.call(true);
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1(10); //=> 12
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1(10); //=> 12
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1(10); //=> 12
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1(10); //=> 12
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1(10); //=> 12
function My(a) { this.a = a; } My.prototype = {
m1: function(b) { return this.a + b; } }; var my = new My(1); my.a; //=> 1 my.a = 2; my.m1(10); //=> 12
એ
ϥϜμଜ
function a(func) { return func.call(this, 1); } a(function(b) { return
b + 10; }); //=> 11
function a(func) { return func.call(this, 1); } a(function(b) { return
b + 10; }); //=> 11
function a(func) { return func.call(this, 1); } a(function(b) { return
b + 10; }); //=> 11
function a() { return function() { return 1; }; }
var b = a(); b(); //=>1
(function(a) { return a + 10; })(1); //=> 11
func1 func2 4DPQF ؔ
func1 func2 func1 func2 4DPQF ؔ ؔ
ؔ Ҿ ฦΓ UIJTҾ ڥ UIJT
ؔ ڥΫϩʔδϟ
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
Ϋϥε Ϋϩʔδϟ ঢ়ଶ ෳ ෳ ৼΔ͍ ෳ Ұͭ
function sum(a, b) { return a + b; } var
left = 1; //.... var right = 2; sum(left, right);
function left(a) { return function(b) { return a + b;
}; } var right = left(1); //..... right(2);
MyUI.prototype.do_something = function() { var self = this; this.$el.click(function() {
$(this).val(self.a); }); }
MyUI.prototype.do_something = function() { var self = this; this.$el.click(function() {
$(this).val(self.a); }); }
var a = 1; function func(refA) { var a =
10; return refA(); } func(function() { return a; });
var a = 1; function func(refA) { var a =
10; return refA(); }; func(function() { return a; });
var a = 1; function func() { return a++; };
func(); func();
var a = 1; function func() { return a++; };
func(); func();
var a = 1; function func() { return a++; };
func(); func();
var a = 1; function func() { return a++; };
func(); func();
var a = 1; function func() { return a++; };
func(); func();
var a = 1; function func() { return a++; };
func(); func();
a=1 func
var a = 1; function func() { return a++; };
func(); func();
a=1 func
var a = 1; function func() { return a++; };
func(); func();
a=2 func
var a = 1; function func() { return a++; };
func(); func();
a=2 func
var a = 1; function func() { return a++; };
func(); func();
a=3 func
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
a=1 b,c func
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
a=1 b,c func a=10
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
a=1 b,c func a=10
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
a=1 b,c func a=10
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
a=1 b,c func a=12
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
a=1 b,c func a=12 a=10
var a = 1; function func() { var a =
10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
a=1 b,c func a=12 a=11
var a = 1; function func() { var a =
10; return new Function("", "return a++;") } var b = func(); b();
var a = 1; function func(refA) { var a =
10; return refA(); } func(function() { return a; });
var a = 1; function func(refA) { var a =
10; return refA(); } func(function() { return a; });
var a = 1; function func(refA) { var a =
10; return refA(); } func(function() { return a; });
a=1 func
var a = 1; function func(refA) { var a =
10; return refA(); } func(function() { return a; });
a=1 func refA a=10
var a = 1; function func(refA) { var a =
10; return refA(); } func(function() { return a; });
a=1 func refA a=10
var a = 1; function func(refA) { var a =
10; return refA(); } func(function() { return a; });
a=1 func refA a=10
·ͱΊ
wΞδΣϯμ w։ൃڥ wجຊͱΦϒδΣΫτ wධՁͱ࣮ߦ wϓϩτλΠϓνΣʔϯ wUIJTଋറ wείʔϓνΣʔϯ
࣮ࡍશ෦͏
ภΔͷෆࣗવ
+BWB ໊ࢺͷԦࠃ ͩͬͨ
"DUJPOFYFDVUF 9Y.BOBHFSNBOBHF 9Y#VJMEFSCVJME
৭Μͳදݱ͕͋Δํ͕ ָ͍͠
ಈࢺଜ ໊ࢺଜ ϥϜμଜ
͋Γ͕ͱ͏͍͟͝·ͨ͠