How to concatenate strings, numbers and calculation in console.log with JavaScript

1 Answer

0 votes
let x = 5;
let y = 4;

console.log("(+" + String(x) + ") + " + String(y) + " = " + String(x + y))





/*
run:

"(+5) + 4 = 9"

*/

 



answered Jun 13, 2023 by avibootz
...