📜  javascript代码示例中的$是什么

📅  最后修改于: 2022-03-11 15:03:05.450000             🧑  作者: Mango

代码示例2
//----------------------------------------
//Question:What is ${variable_name} in javascript?
//----------------------------------------
//You can insert variables in a string (If you write string in backtick)
//Example
const username = "Omar";
//This will Work!
console.log(`The username is ${username}`)//The username is Omar
//These wont Work!
console.log("The username is ${username}")//The username is ${username}
console.log("The username is ${username}")//The username is ${username}