09 December 2016

Javascript Diziler Örneği

Javascript Diziler (Array Loop)

<script type="text/javascript">
 var tamsayi = new Array();
 tamsayi[0] = 1;
 tamsayi[1] = 2;
var ondalikli = new Array(1.2, 2.2, 3.2, 4.2, 5.2);
for (var i = 0; i < tamsayi.length; i++) {
 document.write(tamsayi[i]+"</br>");
 }
for (var item in ondalikli) {
 document.write(ondalikli[item]+"</br>");
 }
</script>