Skip to content

Roger-forbes/int-u4l2-23-24-student-exercises

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lesson 4.2 - String Concatenation

Key Points

  • A variable is a container for storing data values. E.g., let variable;
  • Variables can store different data types including numbers and strings.
  • A string is a series of characters or text. E.g., let name = "Mario";
  • Strings are data types and are always enclosed in quotation marks ("" or '').
  • Strings and numbers are written differently. E.g., "seven" vs 7.
  • Only the + operator can be used to concatenate strings.

Examples of String Concatenation

  1. Basic Concatenation:
    let first = "Maria";
    let space = " ";
    let last = "Singh";
    console.log(first + space + last); // "Maria Singh"
  2. Concatenation with Variables:
    let food = "pizza";
    let sentence = "My favorite food is " + food;

Happy coding! 😄

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 46.8%
  • CSS 34.6%
  • JavaScript 18.6%