Loop through all elements in the array using the javascript array length

  • 2020-03-30 01:06:40
  • OfStack


 <script type="text/javascript">
 <!--
var arr = new Array(13.5,3,4,5,6);
for(var i=0;i<arr.length;i++){
 arr[i] = arr[i]/2.0;
}
alert(arr);
 //-->
 </script>

Related articles: