JavaScriptã«ããã¦ã
>>> var a = {foo:1, bar:2, baz:3}
undefined>>> for (x in a) {console.log(x)}
foo
bar
baz
âã®æåã«ã¯ãªãã¨ãæ £ããã®ã§ããã次ã®ç¶æ³ã ã¨ãã¾ã ã«ãããã¾ãã
>>> var b = [1, 2, 3]
undefined>>> for (x in b) {console.log(x)}
0
1
2
ãªãã¸ã§ã¯ãã§ãé
åã§ãããã®ãã¼ï¼ããããã£åã¾ãã¯é
åã¤ã³ããã¯ã¹ï¼ãè¿ãç¹ã§ä¸è²«æ§ãããã®ã§ãããfor (å¤æ° in ãªã¹ã)
ããªã¹ãé
ç®ã®ï¼ã¤ã³ããã¯ã¹çªå·ã§ã¯ãªãã¦ï¼å¤ãè¿ãä¾ãå¤ãã®ã§ãã©ããåéããã¦ãã¾ãã®ã§ãã