Skip to main content
D
JavaScript
JavaScript Strings

JavaScript Strings

JavaScript strings store and manipulate text data.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

JavaScript uses strings to hold text like names, paragraphs, or passwords. Strings always sit inside quotes so the computer doesn't confuse them with code commands. You can measure, cut, or combine strings easily.

Syntax

Syntax
1/* string syntax */
2let name = "John";
3let greeting = 'Hello';

Key Points

  • Strings require single or double quotes.
  • The `length` property counts the characters.
  • Backslashes escape special characters inside strings.
  • Template literals use backticks to inject variables.

Up Next

Continue your journey with the next topic.

Go to JS String Methods