Skip to content

Commit d7f93b5

Browse files
committed
Minor updates, add definition of CONCATENATION
1 parent e8f9d6f commit d7f93b5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Tutorials/Basic/01_variables/03_string_vars.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
// 03_string_vars.js
22

33
// Declaring and initializing first name and last name
4-
var firstName = "Pranjal";
5-
var lastName = "Prakarsh";
4+
var firstName = "Max";
5+
var lastName = "Barry";
66

77
// Concatenating strings
8+
/* Concatenating refers to linking two things together, in JavaScript, concatenation of strings simply means to link any two strings together.
9+
For example:
10+
const fullSentence = "This is sentence 1" + "This is Sentence 2"
11+
*/
812
var fullName = firstName + " " + lastName;
913

1014
// Concatenating strings using template literals
11-
var fullNameTemplate = `${firstName} ${lastName}`;
15+
var fullNameTemplate = `${firstName} ${lastName}`; // PREFERRED
1216
// Concatenating strings (EASIER)
1317
var fullName = firstName + " " + lastName;
1418

0 commit comments

Comments
 (0)