for-inæ§æã§ä½è¨ãªããããã£ãåºãã¨ãã話ã¯è¯ãèãã¾ãããèªåã§è¨å®ãã¦ãåºã¦ããªãããããã£ãããã®ã¯ç¥ãã¾ããã§ããã
以ä¸ã®ããã«ãããã¤ãããããã£ãè¨å®ãã¦for-inæ§æã§åãã¦ã¿ã¾ããã
var object = { constructor: function() {}, prototype: function() {}, valueOf: function() {}, toString: function() {}, MyProperty: function() {} }; for (var i in object) { alert(i); }
çµæãFirefoxã§ã¯5åå
¨ã¦åæãããã®ã§ãããIE6ã§ã¯constructor,toString,valueOfãé¤ããprototype,MyPropertyã®2åããåæããã¾ããã§ãããprototypeãåºã¦ãã辺ããä½ãä¸æè°ãªæãã
追è¨
DontEnumå±æ§ã¨ãããã®ãä»ãã¦ãããããããã§ããã§ãèªåã§è¨å®ããããããã£ã«ã¾ã§ä»ãã¦æ¬²ãããªãå¸ã¬ã¹ã
ä»ã«ãReadOnlyå±æ§ãDontDeleteå±æ§ãInternalå±æ§ã¨ãããã®ããããããã§ããhttp://codezine.jp/a/article.aspx?aid=220#s04
ã¾ã ã¾ã ç¥ããªããã¨ããã£ã±ããããªãã