re: Three types of console.log users. Which one are you? VIEW POST


Method two: Template literals (ES6+)

By wrapping a string in backticks you can append a variable to the string by putting it inside ${}.

console.log (`my variable : ${myVariable}`);

This is the way I should do it, 😜


😁 either this or the other one, the other option does have its advantages (e.g. printing an object or other non-primitives without having to JSON.stringify it)

Code of Conduct Report abuse