LDRize.Operaç¨ã«ãsomeç¸å½ã®é¢æ°ãæ¸ãã¦ãã¦æ°ãã¤ãããã¨ãã¡ã¢ã¡ã¢ã é åãèµ°æ»ããéã«ãç®çã®å¤ãè¦ã¤ãããããã§ã«ã¼ããæãããå ´åã¨ããã®ã¯è¯ãããã±ã¼ã¹ã ã¨æãã¾ããæ®éã«foræãªã©ã§åãå ´åã¯ãbreakã使ãã®ãä¸è¬çã§ãããã ãforEachã§ã¯breakã¯ä½¿ãã¾ããã [1,2,3,4,5].forEach(function(v,i){ console.log(v,i); if ( v > 2) ;//break? }); /* 1 0 2 1 3 2 âããã§æ¢ããã 4 3 5 4 */ ãããã£ãã¨ãã¯Array#some(Array#everyã§ãå¯)ã使ãã¾ãã [1,2,3,4,5].some(function(v,i){ console.log(v,i); return v > 2; }); /* 1 0 2 1 3 2 */ ãã®ã¨ããå½
{{#tags}}- {{label}}
{{/tags}}