WARNING

Are you sure you want to reset the challenge? You'll lose all changes you've made to the code.

What's a String?

A string is just text data, a sequence of characters.

A string can be:

  • empty
let emptyString = "";
  • a single character
let lowercaseA = "a";
let smileyFace = "😊";
let firstLetterOfHewbrewAlphabet = "א";
let space = " ";
let number = "1";
  • a word
let butterfly = "Schmetterling";
  • a sentence
let typingPractice = "The quick brown fox jumped over the lazy dog.";

A string can even contain a whole book.

To create a string, you need to enclose the text in quotation marks. You can use single or double quotes, but they have to match.

let singleQuotes = 'Hello, World!';
let doubleQuotes = "Hello, World!";

// but never...
let mismatchedQuotes = 'Hello, World!";

Practice by following the directions in the code editor. Click ✓ to test your code.