Strings

Strings in JavaScript

One of the five primative Data_types in JavaScript.

A string is a list of characters in sequence. String literals are enclosed in single or double quotes.

Escape characters are used in strings to include a quote or double quote within the string literal.

  • Example: \'

Backticks (`) are used for string template literals; these avoid some of the issues caused by quotes as you don't need to use escape characters to add them.

Backticks enable string interpolation to include JavaScript expressions.

  • Example: Kevin is ${age} years old.

Children
  1. Concatenation