My code keeps telling me
my padRow function should return the value of the name parameter,
please tell me what should i do??
Your code so far
const character = "#";
const count = 8;
const rows = [];
// User Editable Region
function padRow(name) {
return "Hello!";
}
// User Editable Region
const call = padRow();
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/124.0.0.0 Safari/537.36
Challenge Information:
Learn Introductory JavaScript by Building a Pyramid Generator - Step 48
Ok so this step appears to be testing one’s ability to identify different parts of a function’s anatomy.
Essentially, a function could contain a name, might or might not contain some parameters and will always contain a body where something will be returned.
A function could like something like this:
function name (parameter1, parameter2, etc...) {
this is the body
}
The challenge furnishes you with:
function padRow(name) {
return "Hello!";
}
which return a string at the moment.
You need to amend the return line to return the parameter supplied.