ã¯ãã¼ã¸ã£ã¯ãç解ãããããä½ãã»ããç°¡å ååã®è¨äºã§ã¯ããé¢æ°ãè¿ãé¢æ°ããããã£ã¦ããããªãã¯ãã¼ã¸ã£ãä½ã£ã¦ãã¾ãã¾ããã ãããªãã¤ã§ãã <script> //ãµã³ãã«5-1 function outer(){ var x = 1; ã// outerã®ã¹ã³ã¼ãå ã§å¤æ°ãå®ç¾© returnãfunction (){ //ãã®é¢æ°ããã¯ãã¼ã¸ã£ã alert(x); // "é¢æ°å é¢æ°"ã®ä¸ã§ãouterã¹ã³ã¼ãã®å¤æ°ãåç §ã }; } var f = outer(); f(); // 1ã¨è¡¨ç¤ºã </script> ãããä½æ ã¯ãã¼ã¸ã£ãªã®ãã¨ããã¨ã次ã®æ¡ä»¶ãæºããã¦ããããã§ãã outerã®ã¹ã³ã¼ãå ã§å¤æ°ãå®ç¾©ãã outerã®ä¸ã«é¢æ°(=é¢æ°å é¢æ°)ãä½ã£ã¦ ãã®é¢æ°å é¢æ°ãããå ã»ã©ã®å¤æ°ãåç §ãã ä½ã®å½¹ã«ç«ã¤ã®ãï¼ ãã¯ãã¼ã¸ã£ãä½ããã®ã¯ãããã©ãä½ããããã
{{#tags}}- {{label}}
{{/tags}}