Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Java エンジニアのためのJavaScript講座

Java エンジニアのためのJavaScript講座

D086406794046c4dc23ab027701f6d43?s=128

Takeshi Kawajiri

April 24, 2013
Tweet

Transcript

  1. ೥݄೔ !L[SJ ++6(φΠτɾηϛφʔ ʮ+BWBΤϯδχΞͷͨΊͷ+BWB4DSJQUߨ࠲ʯ ໊ࢺԦࠃͱͭͷଜͷ࿩

  2. ઒৲߶ 4*԰

  3. /&8

  4. "MMZPVSCBTFBSFCFMPOHUPVT

  5. ετΞΞϓϦ

  6. None
  7. None
  8. None
  9. +BWB4DSJQU͸ ։ൃऀͷڞ௨ݴޠ΁

  10. ΩʔϝοηʔδΛதԝʹදࣔ ϑΥϯτ ώϥΪϊ֯ΰ4UE/QU +BWB4DSJQUͷॻ੶ʹৄ͍͠ େ઒ઌੜ ૉࡐ ࠓ

  11.          

        ࡭ ࡭ ࡭ ࡭ ࡭ ࡭ ࡭ ࡭ ࡭ ࡭ ࡭ ࡭ ࡭ ࡭
  12. None
  13. +BWBͷ ઓ࢜ 1SPHSBNNFS ຐ๏࢖͍ )BDLFS ૐཿ 2"

  14. ಈࢺଜ ໊ࢺଜ ϥϜμଜ

  15. Ճ೤(ᣀ, 105); ଍͢_ϖΫνϯ(ᣀ); ࠞͥΔ(ϨϞϯ, ᣀ); ಈࢺଜ

  16. ໊ࢺଜ new ು; ು.଍͢(ᣀ); ು.Ճ೤(105); ು.଍͢(ϖΫνϯ);

  17. ϥϜμଜ $(ᣀ).Ճ೤(λ{ Թ౓ < 105 }).ࠞͥΔ(ϖΫνϯ, λ{ Ώͬ͘Γͱ }).ࠞͥΔ(...

  18. ಈࢺଜ ໊ࢺଜ ϥϜμଜ

  19. ຊ೔ͷΰʔϧ

  20. wΞδΣϯμ w։ൃ؀ڥ wجຊ஋ͱΦϒδΣΫτ wධՁͱ࣮ߦ wϓϩτλΠϓνΣʔϯ wUIJTଋറ wείʔϓνΣʔϯ

  21. ๯ݥͷ४උ

  22. None
  23. None
  24. ຊؾʹͳͬͨΒ

  25. None
  26. None
  27. None
  28. None
  29. None
  30. None
  31. ϞμϯΛࣹఔڑ཭ʹஔ͘

  32. ಈࢺଜ

  33. var a = 1; function func(b) { return a +

    b; } func(10); //=> 11
  34. var a = 1; function func(b) { return a +

    b; } func(10); //=> 11 ม਺એݴ
  35. var a = 1; function func(b) { return a +

    b; } func(10); //=> 11 ؔ਺એݴ
  36. var a = 1; function func(b) { return a +

    b; } func(10); //=> 11 Ҿ਺ ฦΓ஋
  37. var a = 1; function func(b) { return a +

    b; } func(10); //=> 11 ֎෦ม਺ͷࢀর
  38. var a = 1; function func(b) { return a +

    b; } func(10); //=> 11 ؔ਺ݺͼग़͠
  39. var a = 1; function func(b) { return a +

    b; } func(10); //=> 11 ࣝผࢠ
  40. var a = 1; function func(b) { return a +

    b; } func(10); //=> 11 ਺஋
  41. ϓϦϛςΟϒ஋ ͱ ΦϒδΣΫτ

  42.  ͱ OFX/VNCFS 

  43. B ͱ OFX4USJOH B

  44. ۠ผͰ͖ͳ͍஋ ͱ ۠ผͰ͖Δ஋

  45.  ͱ OFX/VNCFS    OFX/VNCFS 

  46. ஋Λ౉͢஋ ͱ ࢀরΛ౉͢஋

  47. WBSBC ͱ WBSBC OFX/VNCFS  

  48. ୯Ұͷ஋ ͱ ঢ়ଶΛ࣋ͭ஋

  49. var n = new Number(1); n["prop1"] = 1; n["prop1"]; //=>

    1 n.prop2 = 2; n.prop2; //=>2 Ç QSPQ O  QSPQ 
  50. ϓϦϛςΟϒ஋ ΦϒδΣΫτ ൺֱ ಉ஋ੑ ಉҰੑ ୅ೖ ஋ ࢀর ঢ়ଶͷอ࣋ ʷ

    ˓
  51. wϓϦϛςΟϒ஋ ‣਺஋    /B/ ‣จࣈྻ B BC 

    ‣ਅِ஋ USVF GBMTF ‣OVMM ‣VOEFpOFE
  52. wΦϒδΣΫτ ‣0CKFDU ‣"SSBZ ‣/VNCFS ‣4USJOH ‣#PPMFBO ‣'VODUJPOͳͲ

  53. wΦϒδΣΫτ ‣0CKFDU ‣"SSBZ ‣/VNCFS ‣4USJOH ‣#PPMFBO ‣'VODUJPOͳͲ

  54. var obj = new Object; obj.a = 1; obj.a; //=>

    1 var obj = { a: 1 }; obj.a; //=>1
  55. var arr = new Array; arr[0] = 1; arr[0]; //=>

    1 var arr = [1, 2]; arr[0]; //=> 1
  56. var arr = [1, 2]; arr[100] = 3; arr.a =

    1;  BSS      B 
  57. wΦϒδΣΫτ ‣0CKFDU ‣"SSBZ ‣/VNCFS ‣4USJOH ‣#PPMFBO ‣'VODUJPOͳͲ

  58. new Number(1) + new Number(2); //=> 3

  59. (1).a = 1; (1).a; //=> undefined; (new Number(1)).a = 1;

    (new Number(1)).a; //=> undefined
  60. wΦϒδΣΫτ ‣0CKFDU ‣"SSBZ ‣/VNCFS ‣4USJOH ‣#PPMFBO ‣'VODUJPOͳͲ

  61. function a(){} var b = a; b(); var c =

    function() { }; c();
  62. var obj = { m: function(a) { return a +

    1; } }; obj.m(1); //=> 2
  63. ධՁͱ࣮ߦ

  64. var a, b = 1; a = 2; function c(d)

    { var e = 5; } c(2);
  65. var a, b = 1; a = 2; function c(d)

    { var e = 5; } c(2);
  66. a(); function a(){} b(); //ERROR var b = function(){};

  67. TDSJQU IUNM

  68. var a, b = 1; a = 2; function c(d)

    { var e = 5; } c(2);
  69. var a = 1; function f1() { var b =

    2; function f2() { var c = 3; }; }
  70. if(false) { var a = 1; } for(var i=0; i<3;

    i++) { }
  71. ໊ࢺଜ

  72. 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
  73. 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ࣜ
  74. 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 ίϯετϥΫλ
  75. 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 Πϯελϯε
  76. 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 ϓϩτλΠϓ
  77. 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 ϝιου
  78. 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
  79. .Z OFX ίϯετϥΫλ Πϯελϯε B

  80. 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
  81. N .Z OFX ίϯετϥΫλ ϓϩτλΠϓ Πϯελϯε ҕৡ QSPUPUZQF B

  82. 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
  83. N .Z OFX ίϯετϥΫλ ϓϩτλΠϓ Πϯελϯε ҕৡ QSPUPUZQF UP4USJOH 0CKFDU

    ҕৡ ϓϩτλΠϓ ίϯετϥΫλ OFX QSPUPUZQF B
  84. N .Z OFX ίϯετϥΫλ ϓϩτλΠϓ Πϯελϯε ҕৡ QSPUPUZQF B $MBTT

  85. w+BWBͰͷΫϥε ˒ςϯϓϨʔτ ˒ڇ ˒֓೦

  86. w+BWBͰͷΫϥε ˒ςϯϓϨʔτ ˒ڇ ˒֓೦

  87. ςϯϓϨʔτ ͨ͜ম͖ͷܕ ઃܭॻ ਽ܗ Original Update by Will Scullin

  88. Ϋϥεͬͯखஈʁ Original Update by Will Scullin

  89. Original Update by Keith Williamson

  90. Original Update by Keith rfranklinaz

  91. ςϯϓϨʔτ ͨ͜ম͖ͷܕ ઃܭॻ ਽ܗ Original Update by Will Scullin

  92. Ϋϥεͬͯܕʁ Original Update by Will Scullin

  93. Original Update by Leo-setä

  94. var my = new My(1); my.m2 = function() { };

    my.m2();
  95. w+BWBͰͷΫϥε ˒ςϯϓϨʔτ ˒ڇ ˒֓೦

  96. Original Update by admiller ݘ͕ϫϯϫϯ ڇ͕ϞʔϞʔ ೣ͕χϟʔ

  97. Original Update by admiller Ϋϥεͬͯෆมʁ

  98. $("#div_id") .toggleClass('oldClass newClass');

  99. 4*԰ 3VCZJTU ͓̽͡͞ ߨࢣ ͓෕͞Μ /&8

  100. ޱ࠲ Original Update by Dirk_Vorderstraße

  101. var n = new Number(1); n instanceof Number; //=> true

    n.__proto__ = String.prototype n instanceof Number; //=> false n instanceof String; //=> true
  102. Original Update by admiller Ϋϥεͬͯ ඞਢʁ

  103. Կऀʹ΋ͳΕͳ͍ ΦϒδΣΫτ

  104. Object.prototype instanceof Object; //=> false Object.create(null) instanceof Object; //=> false

  105. w+BWBͰͷΫϥε ˒ςϯϓϨʔτ ˒ڇ ˒֓೦

  106. Original Update by Keith jodelli ֓೦ͱ࣮ମ ΠσΞͱ࣮ࡏ ʮBQQMFʯͱʮBOBQQMFʯ

  107. "QQMF OFX Ϋϥεఆٛ Πϯελϯε ιʔείʔυ ΠσΞ ϝϞϦ ݱ࣮ BQQMF

  108. Apple? "QQMF OFX Ϋϥεఆٛ ΫϥεΦϒδΣΫτ Πϯελϯε DMBTT ιʔείʔυ ֓೦ ϝϞϦ

    ݱ࣮ BQQMF
  109. Apple? "QQMF OFX Ϋϥεఆٛ ΫϥεΦϒδΣΫτ Πϯελϯε DMBTT ιʔείʔυ ֓೦ ϝϞϦ

    ݱ࣮ BQQMF $MBTT
  110. N .Z OFX ίϯετϥΫλ ϓϩτλΠϓ Πϯελϯε ҕৡ QSPUPUZQF B $MBTT

  111. N .Z OFX ίϯετϥΫλ ϓϩτλΠϓ Πϯελϯε ҕৡ QSPUPUZQF B

  112. 0CKFDU

  113. 0CKFDU $MBTT

  114. Original Update by Keith Williamson

  115. Original Update by Keith rfranklinaz

  116. 0CKFDU $MBTT

  117. $("#div_id") .toggleClass('oldClass newClass');

  118. &MFNFOU $MBTT

  119. Apple? "QQMF OFX Ϋϥεఆٛ ΫϥεΦϒδΣΫτ Πϯελϯε DMBTT ιʔείʔυ ֓೦ ϝϞϦ

    ݱ࣮ BQQMF
  120. 0CKFDU $MBTT

  121. Original Update by Leo-setä

  122. 0CKFDUϓϩτλΠϓ 0CKFDUΠϯελϯε

  123. var n = new Number(1); n instanceof Number; //=> true

    n.__proto__ = String.prototype n instanceof Number; //=> false n instanceof String; //=> true
  124. Object.prototype instanceof Object; //=> false Object.create(null) instanceof Object; //=> false

  125. 0CKFDUϓϩτλΠϓ ܧঝΦϒδΣΫτ .ZϓϩτλΠϓ

  126. 0CKFDUϓϩτλΠϓ 0CKFDUΠϯελϯε .ZϓϩτλΠϓ .ZΠϯελϯε

  127. Object prototype prototype obj2 new MyClass my1 my2

  128. .Z Ϋϥεఆٛ Πϯελϯε DMBTT ιʔείʔυ ֓೦ ϝϞϦ ݱ࣮ BQQMF 0CKFDU

    Ϋϥεఆٛ DMBTT ந৅ઢ ܧঝઢ $MBTT$MBTT
  129. N ҕৡઢ ϓϩτλΠϓ Πϯελϯε UP4USJOH ϓϩτλΠϓ B 'VODUJPOϓϩτλΠϓ .Z 0CKFDU

  130. .Z Ϋϥεఆٛ Πϯελϯε DMBTT ιʔείʔυ ֓೦ ϝϞϦ ݱ࣮ BQQMF 0CKFDU

    Ϋϥεఆٛ DMBTT ந৅ઢ ܧঝઢ $MBTT$MBTT
  131. .Z Ϋϥεఆٛ Πϯελϯε DMBTT ιʔείʔυ ֓೦ ϝϞϦ ݱ࣮ BQQMF 0CKFDU

    Ϋϥεఆٛ DMBTT ந৅ઢ ܧঝઢ $MBTT$MBTT
  132. N ҕৡઢ ϓϩτλΠϓ Πϯελϯε UP4USJOH ϓϩτλΠϓ B 'VODUJPOϓϩτλΠϓ .Z 0CKFDU

  133. N ҕৡઢ ϓϩτλΠϓ Πϯελϯε UP4USJOH ϓϩτλΠϓ B 'VODUJPOϓϩτλΠϓ .Z 0CKFDU

  134. UIJTࢀর

  135. 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
  136. B  N 0CKFDU

  137. N B  B  N

  138. N B  B  N

  139. ؔ਺ Ҿ਺ ฦΓ஋ Ҿ਺Ϧετ ؔ਺ຊମ

  140. ؔ਺ Ҿ਺ ฦΓ஋ UIJTҾ਺ ؀ڥ

  141. a.b(); a.b<<a>>(); a.b.c(); a.b.c<<b>>();

  142. 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
  143. ͲΜͳUIJT΋ม͑Δ ࠷ڧͷໃ 'VODUJPODBMM

  144. function func(b) { this.a; } func.call({a:1}, 10);

  145. function func(b) { this.a; } func.call({a:1}, 10);

  146. ͲΜͳࢦఆ͔Β΋कΔ ࠷ڧͷ६ 'VODUJPOCJOE

  147. function func(b) { this.a; } func.bind({a:1})(10);

  148. function func(b) { this.a; } func.bind({a:1})(10);

  149. function func(b) { this.a; } func.bind({a:1})(10);

  150. func.bind({a:1}) .call({a:2}); ΄͜ʷͨͯ 'JHIU

  151. function MyUI($el, a) { this.a = a; $el.click(this.m); } MyUI.prototype.m

    = function(){ this.a };
  152. function MyUI($el, a) { this.a = a; $el.click(this.m); } MyUI.prototype.m

    = function(){ this.a };
  153. function MyUI($el, a) { this.a = a; $el.click(this.m); } MyUI.prototype.m

    = function(){ this.a };
  154. function MyUI($el, a) { this.a = a; $el.click(this.m.bind(this)); } MyUI.prototype.m

    = function(){ this.a };
  155. ؔ਺ Ҿ਺ ฦΓ஋ UIJTҾ਺ ؀ڥ UIJT஋

  156. func.call(undefined); func.call(null); func.call(1); func.call(“a”); func.call(true);

  157. 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
  158. 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
  159. 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
  160. 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
  161. 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
  162. 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
  163. એ఻

  164. ϥϜμଜ

  165. function a(func) { return func.call(this, 1); } a(function(b) { return

    b + 10; }); //=> 11
  166. function a(func) { return func.call(this, 1); } a(function(b) { return

    b + 10; }); //=> 11
  167. function a(func) { return func.call(this, 1); } a(function(b) { return

    b + 10; }); //=> 11
  168. function a() { return function() { return 1; }; }

    var b = a(); b(); //=>1
  169. (function(a) { return a + 10; })(1); //=> 11

  170. func1 func2 4DPQF ؔ਺

  171. func1 func2 func1 func2 4DPQF ؔ਺ ؔ਺

  172. ؔ਺ Ҿ਺ ฦΓ஋ UIJTҾ਺ ؀ڥ UIJT஋

  173. ؔ਺ ؀ڥΫϩʔδϟ

  174. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  175. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  176. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  177. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  178. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  179. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  180. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  181. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  182. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  183. Ϋϥε Ϋϩʔδϟ ঢ়ଶ ෳ਺ ෳ਺ ৼΔ෣͍ ෳ਺ Ұͭ

  184. function sum(a, b) { return a + b; } var

    left = 1; //.... var right = 2; sum(left, right);
  185. function left(a) { return function(b) { return a + b;

    }; } var right = left(1); //..... right(2);
  186. MyUI.prototype.do_something = function() { var self = this; this.$el.click(function() {

    $(this).val(self.a); }); }
  187. MyUI.prototype.do_something = function() { var self = this; this.$el.click(function() {

    $(this).val(self.a); }); }
  188. var a = 1; function func(refA) { var a =

    10; return refA(); } func(function() { return a; });
  189. var a = 1; function func(refA) { var a =

    10; return refA(); }; func(function() { return a; });
  190. var a = 1; function func() { return a++; };

    func(); func();
  191. var a = 1; function func() { return a++; };

    func(); func();
  192. var a = 1; function func() { return a++; };

    func(); func();
  193. var a = 1; function func() { return a++; };

    func(); func();
  194. var a = 1; function func() { return a++; };

    func(); func();
  195. var a = 1; function func() { return a++; };

    func(); func();
  196. a=1 func

  197. var a = 1; function func() { return a++; };

    func(); func();
  198. a=1 func

  199. var a = 1; function func() { return a++; };

    func(); func();
  200. a=2 func

  201. var a = 1; function func() { return a++; };

    func(); func();
  202. a=2 func

  203. var a = 1; function func() { return a++; };

    func(); func();
  204. a=3 func

  205. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  206. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  207. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  208. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  209. a=1 b,c func

  210. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  211. a=1 b,c func a=10

  212. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  213. a=1 b,c func a=10

  214. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  215. a=1 b,c func a=10

  216. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  217. a=1 b,c func a=12

  218. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  219. a=1 b,c func a=12 a=10

  220. var a = 1; function func() { var a =

    10; return function() { return a++; }; } var b = func(); b(); //=> 10 b(); //=> 11 var c = func(); c(); //=> 10
  221. a=1 b,c func a=12 a=11

  222. var a = 1; function func() { var a =

    10; return new Function("", "return a++;") } var b = func(); b();
  223. var a = 1; function func(refA) { var a =

    10; return refA(); } func(function() { return a; });
  224. var a = 1; function func(refA) { var a =

    10; return refA(); } func(function() { return a; });
  225. var a = 1; function func(refA) { var a =

    10; return refA(); } func(function() { return a; });
  226. a=1 func

  227. var a = 1; function func(refA) { var a =

    10; return refA(); } func(function() { return a; });
  228. a=1 func refA a=10

  229. var a = 1; function func(refA) { var a =

    10; return refA(); } func(function() { return a; });
  230. a=1 func refA a=10

  231. var a = 1; function func(refA) { var a =

    10; return refA(); } func(function() { return a; });
  232. a=1 func refA a=10

  233. ·ͱΊ

  234. wΞδΣϯμ w։ൃ؀ڥ wجຊ஋ͱΦϒδΣΫτ wධՁͱ࣮ߦ wϓϩτλΠϓνΣʔϯ wUIJTଋറ wείʔϓνΣʔϯ

  235. ࣮ࡍ͸શ෦࢖͏

  236. ภΔͷ͸ෆࣗવ

  237. +BWB͸ ໊ࢺͷԦࠃ ͩͬͨ

  238. "DUJPOFYFDVUF 9Y.BOBHFSNBOBHF 9Y#VJMEFSCVJME

  239. ৭Μͳදݱ͕͋Δํ͕ ָ͍͠

  240. ಈࢺଜ ໊ࢺଜ ϥϜμଜ

  241. ͋Γ͕ͱ͏͍͟͝·ͨ͠