-1

I want to add a comma in the alert() command like console command. But it does not work.

alert(`what you input is ${m}`, typeof m);
console.log(`what you input is ${m}`, typeof m);
Alexander Nied
  • 12,804
  • 4
  • 25
  • 45
  • Documentation: [`alert`](//developer.mozilla.org/en/docs/Web/API/Window/alert), [`console.log`](//developer.mozilla.org/en/docs/Web/API/console/log). – Sebastian Simon Dec 19 '22 at 21:00

1 Answers1

3

alert takes only one argument

const m = 3
alert(`what you input is ${m}, ${typeof m}`);
Konrad
  • 21,590
  • 4
  • 28
  • 64