So this snippet will make it possible for you to display even if you have no idea on the length and size of your array using the length() method of an array.
<script type="text/javascript"> var animals = ("dog","cat","elephant","snake"); for (var i=0;i<animals.length;i++) { document.write(animals[i] + "<br />"); } </script>
Good luck and Enjoy coding.
No comments:
Post a Comment