File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Tutorials/Basic/01_variables Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
// 03_string_vars.js
2
2
3
3
// Declaring and initializing first name and last name
4
- var firstName = "Pranjal " ;
5
- var lastName = "Prakarsh " ;
4
+ var firstName = "Max " ;
5
+ var lastName = "Barry " ;
6
6
7
7
// 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
+ */
8
12
var fullName = firstName + " " + lastName ;
9
13
10
14
// Concatenating strings using template literals
11
- var fullNameTemplate = `${ firstName } ${ lastName } ` ;
15
+ var fullNameTemplate = `${ firstName } ${ lastName } ` ; // PREFERRED
12
16
// Concatenating strings (EASIER)
13
17
var fullName = firstName + " " + lastName ;
14
18
You can’t perform that action at this time.
0 commit comments