Strings: Working with Text
Learn how JavaScript stores and manipulates text using strings — from creating them with quotes to combining and transforming them.
Text lives inside quotes
Every piece of text you see on a website — usernames, search results, error messages, button labels — is stored in JavaScript as a string. A string is simply a sequence of characters (letters, numbers, spaces, symbols) wrapped in quotes. Without strings, JavaScript couldn't handle any text at all — no displaying names, no reading what someone typed, no showing messages.
You create a string by wrapping text in quotes. JavaScript gives you three options: single quotes ('hello'), double quotes ("hello"), or backticks (`hello`). Single and double quotes work identically — pick one style and be consistent. Backticks are special and we'll explore them shortly.