Continue

  다른 뜻에 대해서는 iter 문서를 참조하십시오.
continue
next

1 Bash[ | ]

ARR=(1 12 3 14)
for VALUE in "${ARR[@]}"; do
  if(("$VALUE" < "10")); then 
    continue
  fi
  echo $VALUE
done
# 12
# 14

2 jQuery[ | ]

var nums = [8, 4, 1, 7, 3];
$.each(nums, function(i, num) {
	if ( num > 5 ) return true; // continue
	console.log( num );
});
// 4
// 1
// 3

3 PHP[ | ]

for
$arr = array(1, 12, 3, 14);
for($i=0; $i<count($arr) ;$i++) {
  if($arr[$i] < 10) continue;
  echo "${arr[$i]}<br>";
}
// 12
// 14
foreach
$arr = array(1, 12, 3, 14);
foreach($arr as $value) {
  if($value < 10) continue;
  echo "$value<br>";
}

4 Python[ | ]

nums = [1, 12, 3, 14]
for num in nums:
	if num<10:
		continue
	print(num)
# 12
# 14

5 Perl[ | ]

my @nums = (1, 12, 3, 14);
foreach my $num (@nums) {
	if ( $num < 10 ) {
		next;
	}
	printf("$num\n");
}
# 12
# 14

6 Ruby[ | ]

for i in 1..5
    next if i % 2 == 1
    puts i
end
# 2
# 4

7 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}