What is wrong with this code? And do you know at what step the repeat function was introduced?
Your code so far
const character = "#";
const count = 8;
const rows = [];
// User Editable Region
function padRow(rowNumber, rowCount) {
return repeat(rowNumber);
}
// User Editable Region
for (let i = 0; i < count; i = i + 1) {
rows.push(character.repeat(i + 1))
}
let result = ""
for (const row of rows) {
result = result + "\n" + row;
}
console.log(result);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 65
Part of programming is being able to research and find solutions. As im59138 stated, you could search in the same way that we have done to find the answers to when something was introduced.
In this way, you are building your research and resolve skills, too.
Its one thing to do research its another, if you agree with me, to manually go back on the steps to which lesson treated a particular prompt. It would be noble, but isn’t the whole point of programming finding the most optimal solution?
Well, how do you think someone else is going to find the step you are asking for? I would check each step until I find the right one, and from the phone, which is what I was using then, is quite difficult.