I completed the exercises in Chapter 10, but the console outputs for my makeIsoscelesTriangle and makeDiamond functions produce logic errors. The lengths for both outputs are correct (ex. console.log(makeIsoscelesTriangle(5).length is 50). Yet, an empty line is printed at the end of the makeIsoscelesTriangle and two empty lines are printed at the end of my makeDiamonds.
All of my other functions in the exercises print correctly without blank lines. I’m worried that my functions are wrong because I used return statements instead of console.log(). I didn’t use console.log() because undefined printed after everything else printed correctly. Also, I set if-then conditional statements to add “\n” only in certain circumstances. I know that the instructions stated not to add “\n” to the end of the string. Yet, with the conditions set, I did not experience any logic errors until now.
Is there a way to use both console.log() and “n”? Will I need to refactor my previous functions?