I'm very new to coding. What would be the way to execute this using less lines of code?
for (var i=1; i <= 7; i++){
if (i == 1) console.log("#");
else if (i == 2) console.log("##");
else if (i == 3) console.log("###");
else if (i == 4) console.log("####");
else if (i == 5) console.log("#####");
else if (i == 6) console.log("######");
else if (i == 7) console.log("#######");
}
I'ver been trying to use the while loop but I'm not understanding how to print multiple '#"s in less lines of code