forked from Swap76/Learn-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstringOperation.js
More file actions
15 lines (8 loc) · 765 Bytes
/
Copy pathstringOperation.js
File metadata and controls
15 lines (8 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const into = "My college is SIESGST. Our seniors and alumnus are best in Mumbai";
const fullName = "My name is Swapnil Satish Shinde";
const branch = "I belong to Computer Science branch";
const oldBio = into + " " + fullName + " " + branch;
const bio = `${into} ${fullName} ${branch}`; // New way of concatenation
console.log(oldBio); // My college is SIESGST. Our seniors and alumnus are best in Mumbai My name is Swapnil Satish Shinde I belong to Computer Science branch
console.log(bio); // My college is SIESGST. Our seniors and alumnus are best in Mumbai My name is Swapnil Satish Shinde I belong to Computer Science branch
// Output by both the methods is same but string interpolation is more beautiful as we only have to right 1 line for all we want