先n=1,判断n是否<=10,满足条件,n+1,输出n,再次判断n是否<=10,循环..........
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
for(var n=1;n<=10;n++){
console.log(n)
}
</script>
</body>
</html>