Insert variable values in the middle of a string in Javascript
how to put variable in string javascript
var myInt = 1
console.log(`my variable is ${myInt}`);
// my variable is 1
console.log(`Hello World`);
Output
Hello World
var myInt = 1
console.log(`my variable is ${myInt}`);
// my variable is 1
console.log(`Hello World`);
In this page (written and validated by A. Gawali) you learned about . What's Next? If you are interested in completing Javascript tutorial, we encourage you simply to start here: Javascript Tutorial.
Share On: |