hi guys
ill be grateful if any one of you give me a hint about step 69
i wrote down this line but it was not a solution!!!
console.log(character);
return “rowCount " + character.repeat(” ") + “rowNumber”;
Your code so far
const character = "-";
const count = 8;
const rows = [];
// User Editable Region
function padRow(rowNumber, rowCount) {
console.log(character);
return "rowCount " + character.repeat(" ") + "rowNumber";
}
// User Editable Region
for (let i = 0; i < count; i = i + 1) {
rows.push(padRow(i + 1, count));
}
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/126.0.0.0 Safari/537.36
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 69
is that mean that i should omit character and instead ad an empty space of string " " before my repeat??
you mean this : " “.repeat(rowNumber)+” " !!!
if you mean that it is still not correct
should i also use dot in empty space?
where should i put rowCount and rowNumber ??!!
if it should be placed in empty spaces between and and after character.repeat(rowNumber) i placed it once but it was still wrong!!!
more clear guidance please !
As you can see you didn’t use the same quote characters. It should be like this: " ".repeat()
A blank space should be repeated ‘rowCount - rowNumber’. You only have the rowNumber as the number of repeated blank spaces. The same statement should be on the right side of the character.repeat(rowNumber) too. So, instead of only having quotes as in the given code in this challenge you should have “”.repeat… (as mentioned above).
by blank space you mean () or “” ??
by the way when i wrote down the quotes on the test they were the same but when i copy pasted them here the shape of the quote just changed?! dont know why!!!
Hi there!
Blank space is the to double quote marks " " , that contains a space between it.
You need to reset your challenge step and add .repeat() method on both blank space strings, and add rowCount - rowNumber times as an argument.
hi mr hasan.
thanks for guidance
istill have bunch of problem
one what do you exactly mean by resting my challange ! is that an idiom ?
you mean something like that?
" " .repeat() + character.repeat(rowNumber) + " ".repeat();
and what it mean rowCount - rowNumber times!! it means i should add this two item (`rowCount - rowNumber) in my blank like this
"rowCount - " .repeat() + character.repeat(rowNumber) + " rowNumber ".repeat();
please help me with more detail tnx
i also try that
return " rowCount".repeat(1)+“rowNumber”.repeat(1);
and this :
return “rowCount” .repeat(1) + character +"rowNumber ".repeat(1);
and this :
return “rowCount” .repeat(1) + character.repeat() +"rowNumber ".repeat(1);
and also this:
return “rowCount” .repeat(1) + character.repeat(rowNumber) +"rowNumber ".repeat(1);
but non of them was the answer
help me guys!!!
do not change the content of the quotes, the string should contain a space, do not change that
you use repeat() on that string, repeat() gets a number as argument, that number should be rowCount - rowNumber, it’s calculated depending on the values of rowCount and rowNumber. When it says rowCount - rowNumber times, you just put exactly that as number of times the string should be repeated