Monday, 23 December 2013

JavaScript - Generate an array of numbers in between range

<script type="text/javascript">
        var numbers = [];
        min = 0;
        max = 100;
        for (var i = min; numbersArray.push(i++) < max;);
        // numbers = [0,1,2,3 ... 100] 
 </script>

No comments: