ããã«ã¡ã¯ã太ç°ã§ããåã åãååã¨JavaScriptã«ãããç¶æ¿ã«ã¤ãã¦å¦ç¿ãã¾ãããä»åã¯ããã«æ·±ãé¢ããthisã«ã¤ãã¦å¦ãã§ããã¾ãã JavaScriptã®thisã¯ããã¯ã»ã®ããåä½ãããããã«æããããããã¾ããããä»çµã¿ããã£ããææ¡ããã°å®ã«ç°¡åã§ããç¹ã«éè¦ãªã®ã¯æ¬¡ã®2ç¹ã§ãã thisãä½ãæããã¯é¢æ°ã®å¼ã³åºãæ¹ã§æ±ºå®ãã thisã¯é¢æ°ã¹ã³ã¼ãã«åå¨ããç¹æ®ãªå¤æ°ã§ãã ã¤ã³ã¹ã¿ã³ã¹ã¨ãã¦ã®this ã§ã¯ãã¾ãã¯ã³ã³ã¹ãã©ã¯ã¿å ã§ã®ã¤ã³ã¹ã¿ã³ã¹ã¨ãã¦ã®thisãè¦ã¦ã¿ã¾ãããã ã³ã³ã¹ãã©ã¯ã¿ã¨this function A(name){ this.name = name; } A.prototype.getThis=function(){ return this; }; var a = new A('aaa'); console.log(a); console
{{#tags}}- {{label}}
{{/tags}}