Firebugã®ã³ã³ã½ã¼ã«ã§å®è¡ function func_or_obj () { this.arg = 1; return this; } // ãªãã¸ã§ã¯ãçæ var obj = new func_or_obj(); //é¢æ°ã¨ãã¦å®è¡ var func_rtn = func_or_obj(); console.log(obj.arg); // 1 console.log(func_rtn.arg); // 1 console.log(obj); // Object { arg = 1 } console.log(func_rtn); // Window .... //é¢æ°ãããªãã®ã§ã¨ã©ã¼ //var obj_rtn = obj(); ãã¤ã³ã function ã§å®ç¾©ãããé¢æ°ã¯ new ãããã¨ã§ãªãã¸ã§ã¯ãã«ãªã thisã«ã¤ã㦠newããå ´åã¯ãããããçæããããªãã¸
{{#tags}}- {{label}}
{{/tags}}