Help with Build A Pyramid Generator: Super Stuck!

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));

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Get Help > Ask for Help button located on the challenge.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.