Why not to use string concatenation with variables

in #javascript5 years ago (edited)

#JS-BEGINNERS-SERIES #lesson-001

Why not to use string concatenation with variables

Many beginner developers use the string concatenation to match variables with text

Example :
code002.png

But there is an easier way to code this output, which is using the string interpolation used in the ES6 version of javascript. Wich means replacing the quotation marks “” and the plus signs + with a template literal.
A template literal is wrapped by backticks `` and contains a placeholder ${variable} wich contains the variable

Example :

New to Steemit?

Coin Marketplace

STEEM 0.15
TRX 0.27
JST 0.037
BTC 104081.19
ETH 2607.44
USDT 1.00
SBD 0.91