do{}while() 循环

do{}while() 循环至少会循环一次:

语法如下:

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>DEMO - Lik</title>
</head>
<body>
	<script>
		var a = 0;
		do{
			a++;
			console.log(a);
		}while(a<5);
	</script>
</body>
</html>

  控制台会输出:

 

posted @ 2017-07-09 16:42  likwin  阅读(190)  评论(0编辑  收藏  举报