javascript - for loop to print out multiple arrays with similar names -
i've got multiple arrays, so: bugnames0 = ["wasp", "roach", "stinkbug", "mantis"]; bugnames1 = ["hornet", "beetle", "ant", "termite"]; bugnames2 = ["gnat", "fly", "grub", "chigger"]; bugnames3 = ["flea", "bed-bug","maggots", "cricket"]; next have loop: function bugloop() { (var i=0; < 4 ; i++){ console.log(bugnames0[i]); } } that print first array console, or each individually if manually update number in array's name. but there way more this? following code bit doesn't work, hope explains trying do: for (var i=0, j=0; < 4; i++) { console.log(bugnames(i)[j]); } } here represents bugname#, update through 0 - 3 loop runs, printing out first option of each array represented j. goal outcome printed console be: "wasp", "hornet", "gnat", "flea...