IHYPRESS.NET
JAVASCRIPT
HOME | ASP | C | CSS | HTML | JAVASCRIPT | PERL | PHP | PYTHON | RUBY | SVG
Earn Free Bitcoin
JavaScript ❯ Enumeration Loops
<05>
<html><body> <script> //for-in loop (object) document.write ("<div>"); const automobile = {make:"Volkswagen", model:"New Beetle", year:2009, color:"Sunflower Yellow"}; for (x in automobile) document.write (x + " : " + automobile[x] + "<br>"); document.write ("</div><div style='margin-top:10px;color:red;'>"); //for-in loop (arrays) const states = ["Arizona", "Florida", "Massachusetts", "Hawaii", "Maine", "New Jersey", "Michigan"]; for (x in states) document.write (x + " : " + states[x] + "<br>"); document.write ("</div><div style='margin-top:10px;color:blue;'>"); var j = 1; do { document.write ("The number is " + j + "<br>"); ++j; } while (j < 10); document.write ("</div>"); </script> </body></html>
COPYRIGHT © 2015-2024 IHYPRESS.NET. A DIVISION OF IHY PRESS. ALL RIGHTS RESERVED.