Concatenating strings

String concatenation is the result of combining multiple string literals to form an expression. So, let's create one by first entering two string literals:

Combining these two gives us a string concatenation. We can combine strings by using the + operator, add the following:

let full = firstName + lastName

When you look in the Results Panel, you will notice that there is no space between our first and last names.

Also, if we just put the variables in quotes, they will revert to simple string literals and will no longer be variables.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.36.141