Combining Strings
We've already seen in the first lesson that one of the things we can do with strings is combine multiple strings together. Remember we can do this using the + operator. Why don't you try concatenating (combining) the strings "Learn" and "Street", and store it in a variable named ls. Then type ls and press Enter.
var ls = "Learn" + "Street";
ls => 'LearnStreet'
Awesome! The + operator created a new string by copying the characters from "Learn" and "Street".
No comments:
Post a Comment