Template strings let you create strings using backticks and a ${object} syntax, which is pretty familiar, to let you swap variables into strings less painfully.
A Pen by Michael Schofield on CodePen.
Template strings let you create strings using backticks and a ${object} syntax, which is pretty familiar, to let you swap variables into strings less painfully.
A Pen by Michael Schofield on CodePen.
var me = { | |
name : 'Michael', | |
age : '29', | |
eyes : 'blue' | |
} | |
document.write( `Hi, I'm ${me.name}! I'm ${me.age} and my eyes are ${me.eyes}.` ); |