var nums = [6, 88, 0, -1, 34]; var text = ""; var largest=-999; for (var i=0; i < nums.length; i++) { if(nums[i]>largest) largest=nums[i] } alert(largest + "is the largest number in the array");
Post a Comment
No comments:
Post a Comment