Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

putting a loop into an array javascript

function test() {
    var sub_array = [];
    var super_array = [];
    for (var i = 1; i <= 3; i++) {
        sub_array.push(i);
        super_array.push(sub_array.slice(0));
    }
    alert(super_array);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #putting #loop #array #javascript
ADD COMMENT
Topic
Name
6+4 =