interpolation
Node.js
const name = 'bob'
const age = 21
const message = `${name} is ${age} years old`
console.log(message)
Output
bob is 21 years old
Go
package main
import "fmt"
func main() {
name := "bob"
age := 21
message := fmt.Sprintf("%s is %d years old", name, age)
fmt.Println(message)
}
Output
bob is 21 years old
当前内容版权归 miguelmota 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 miguelmota .