In python, I can do the following:
name = "bob"
print("Hey, %s!" % name)
Is there anything similar to that (or Python's .format()
) in JavaScript/NodeJS?
In python, I can do the following:
name = "bob"
print("Hey, %s!" % name)
Is there anything similar to that (or Python's .format()
) in JavaScript/NodeJS?
Another option is template strings
For example:
You can use util.format, it's
printf
like function.sprintf should do what you are asking for I think.