function beer() { var n = 99; while (n>1) { var m = n-1; console.log((n + "bottles of beer on the wall," + n + "bottles of beer. Take one down and pass it around," + m + "bottles of beer on the wall.")); n--; } console.log("No more bottles of beer on the wall, no more bottles of beer.Go to the store and buy some more, 99 bottles of beer on the wall."); } function beer() { var n = 99; var lyrics = ""; while (n > 1) { var m = n - 1; lyrics += n + "bottles of beer on the wall," + n + "bottles of beer. Take one down and pass it around," + m + "bottles of beer on the wall."; lyrics += "\n\n"; n--; } lyrics+=( "No more bottles of beer on the wall, no more bottles of beer.Go to the store and buy some more, 99 bottles of beer on the wall.\n\n" ); return lyrics; } const response = beer(); console.log(response);Solo necesita agregar todas las letras a la cadena y al final simplemente regrese de la función.
espero que esto responda la pregunta