Tell us what’s happening:
i just need help to false as condition in for loop and iteration.
Your code so far
const character = "#";
const count = 8;
const rows = [];
function padRow(rowNumber, rowCount) {
return " ".repeat(rowCount - rowNumber) + character.repeat(2 * rowNumber - 1) + " ".repeat(rowCount - rowNumber);
}
// TODO: use a different type of loop
/*for (let i = 1; i <= count; i++) {
rows.push(padRow(i, count));
}*/
/*while (rows.length < count) {
rows.push(padRow(rows.length + 1, count));
}*/
// User Editable Region
for (let i =count; i !==false; false++){
}
// User Editable Region
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; rv:128.0) Gecko/20100101 Firefox/128.0
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 99
1 Like
Hello there!
Use the booleans in their purest forms. You do not need the strictly not equal operator or the increment operator.
4 Likes
you mean like this
for (let i =count; flase; false){
}
i don’t think it will make since.
3 Likes
That’s ok, they are just placeholders for this exercise. They are not correct syntax, they are just there temporarily like scaffolding at a building construction. I think you will need to spell it correctly though.
4 Likes
i did not notice thank you
Hi,
In the question there mentioned to keep false as boolean value in the condition & iteration statements
As we know the syntax of for loop
for (declaration, condition, iteration) {
logic;
}
Hence, we need to keep it as false in ‘condition’ & ‘iteration’ places, that will be looking like below:
Mod edit: solution code removed
Hope this helps!
3 Likes
@ankithtiwari8 This thread was already marked as solved.
Also, do not post solution code.
It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.
We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.
2 Likes