10

How to append strings in JavaScript?

10 months ago
raja $9kazbS94Gp

One of the coolest things about ES6 is that it gives us a new way to create strings with dynamic values. These are called template literals, and they are awesome!

let firstName = 'John';

let lastName = 'Doe';

let fullName = `${firstName} ${lastName}`;

// Output: 'John Doe'

Last Seen
32 minutes ago
Reputation
0
Spam
0.000
Last Seen
29 minutes ago
Reputation
0
Spam
0.000
Last Seen
42 minutes ago
Reputation
0
Spam
0.000
Last Seen
4 hours ago
Reputation
0
Spam
0.000
Last Seen
23 minutes ago
Reputation
0
Spam
0.000
Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
2 hours ago
Reputation
0
Spam
0.000
Last Seen
27 minutes ago
Reputation
0
Spam
0.000
Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
3 hours ago
Reputation
0
Spam
0.000
Last Seen
9 months ago
Reputation
0
Spam
0.000