how can i define a variable wrong?

i’m doing an assignment where i need to build a function-based console log generator. i need to declare two variables and for some reason the way i’m doing is wrong:

var message;
var style;
function consoleStyler(color, background, fontSize, txt) {
    message = "%c" + txt;
    style = `color: ${color};`;
    style += `background: ${background}`;
    style += `font-size: ${fontSize};`;
    console.log(consoleStyler(message, style));
}

(i declared them outside the function because the assignment needs them later within other function)
The output says there’s a range error and also points specifically the message variable as being wrong.

  • I tried defining the variables inside the function but the full assignment needs them to be global.
  • Also tried leaving the parentheses of “consoleStyler” within the console.log blank, but the assignment especifies that it needs the parameters there.
  • Defining everything inside style also doesn’t work, it needs to be in separate lines of code.
  • I just really don’t get what is wrong at the message variable, the backticks must be included so i’m clueless, if anyone can figure it out something that could help me, i’ll be very thankfull!