I'm beginner with java script, and I am practicing with mdn document.
the code I wrote is working differently with what is written on mdn as below.
"use strict";
let bigInt = 34321321321;
console.log("value: ${bigInt}");
let a = 5;
let b = 10;
console.log("fifteen is ${a+b}");
I just added script tag on index.html, which is default html file.
I did it on google chrome.
what could be the problem?
To use ${variable} you should use back tick ` not double qoutes "".
Back ticks use variables with ${}. If you don't use back ticks then the variable should be applied like below,
let variable = 123213;
console.log("The variable is" + variable);
If ${} is used then,
let variable = 123213;
// backticks are used without double qoutes(")
console.log(`The variable is ${variable}`);
Also there is a MDN reference.