//包含變量或表達式
const a = 10
const b = 20
const c = 'html'
const str = `my age is ${a + b} i love ${c}`
//包含邏輯運算的用法
function Price (strings,type){
let s1 = strings[0]
const retailPrice = 20
const wholeSalePrice = 16
let showTxt
if(type === 'retail'){
showTxt = '購買單價是:' + retailPrice
}else{
showTxt = '購買的批發價是:' + wholeSalePrice
}
return `${s1}${showTxt}`
}
let showTxt = Price`你此次的${retail}`
console.log(showTxt)
//換行寫法
let s = `第一行
第二行`
console.log(s)