1. 程式人生 > >javascript for迴圈條件 2個條件和 3個條件的區別

javascript for迴圈條件 2個條件和 3個條件的區別

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
  <script>
  var c = 1000;
  for (i = 0; c > i;)
 
 h = i * 8,i++ ;
  document.write(h);
  </script>
 </body>

</html>

============

結果 7992

=====================

<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
  <script>
  var c = 1000;
  for (i = 0; c > i;i++ )
 
 h = i  * 8,;
  document.write(h);
  </script>
 </body>
</html>

============

結果 7992

-==================== 結果沒什麼區別

============

結果 7992