hello I can not solve step 58 , and i didn’t understand that step too, i am new to coding .
please help
hi there, can you post a link to the step you are talking about? Also please tell us which sentence or concept you are having a hard time with and show us the code you used so far.
Use the return
keyword to return the value of the character
variable, repeated rowNumber
times.
const character = "#";
const count = 8;
const rows = [];
function padRow(rowNumber, rowCount) {
}
I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>
) to add backticks around text.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').
Take a close look at what you wrote earlier
for (let i = 0; i < count; i = i + 1) {
rows.push(character.repeat(i + 1))
}
in earlier steps, you wrote that for loop.
so you worked with repeat in the past.
you need to work with repeat method again here
the directions say return the value of the character variable, repeated rowNumber times.
hope that helps
Here are the docs for the repeat method if you need to look at more examples
great finally after trying for a day i got my code.
thank you so much for your .repeat link
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.