Created
June 2, 2018 12:31
-
-
Save malikkurosaki/fb760ca1d34f01867abce6b2e01cda18 to your computer and use it in GitHub Desktop.
create multy dimensional array progamaticly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pNation(); | |
function pNation(){ | |
var pn1 = []; | |
var pn2 = []; | |
var isi = 4; | |
for(i = 1;i<=stl.page.length;i++){ | |
pn1.push(i); | |
if(i%isi == 0){ | |
pn2.push(pn1); | |
pn1 = []; | |
} | |
} | |
pn2.push(pn1); | |
console.log(pn2) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment