const character = "#";
const count = 8;
const rows = [];
// User Editable Region
function padRow(test) {
const test = "Testing!";
console.log("This works!")
return test;
}
console.log("This works!")
// User Editable Region
const call = padRow("CamperChan");
console.log(call);
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/92.0.4515.131 Safari/537.36 Edg/92.0.902.67
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 60
The problem may be that your console.log (the bottom one) is outside the function scope (beyond the closing } of the function body).
Move it up so it comes right after the return but before the closing curly brace }
let’s take a step back to the beginning and follow the instructions carefully.
First click reset to get the original code back.
Then follow the first request given which was:
Below the return statement, log the string "This works!" to the console.
When you have done that, making sure that the new log statement is directly below the return statement and directly above the closing parenthesis } then you can move on to the next part of the instructions.
Great! Now you have the first part of the instructions completed. We can move on to the second part which was:
After doing that, you will see that the string "This works!" does not display in the console, and the console.log("This works!") line is greyed out.
Copy the console log and paste it above the return statement. Now, the string "This works!" should appear in the console.
So you should be able to check the console to see that the logged string did --not-- show up there. And the step explains why that is.
After you have confirmed this behaviour you can do the final part which is to copy the new line of code you made (make a copy , do not cut it, just copy it) and paste it above the return statement.