I am so beyond stuck on this one it is making me want to tear my hair out. I have the correct length of the string printed and can’t figure out how to insert the \n line breaks where I need them to be, any help is greatly appreciated here is my code:
function pyramid(str, number, bool)
{
let space = " ";
if(bool === false)
{
let repeatedStr = (str.repeat(number * number))
console.log(repeatedStr);
let newString = "\n" + space.repeat(number) + repeatedStr.slice(0, 1)
console.log(newString)
}
}
console.log(pyramid("o", 3, false));
