Search⌘ K

Introduction

Explore the fundamentals of JavaScript strings, including how to define them, measure their length, change their case, concatenate, and compare strings correctly. This lesson builds a solid foundation for handling text in your JavaScript programs.

String recap

Let’s recapitulate what we already know about strings:

  • A string value represents text.
  • In JavaScript, a string is defined by placing text within single quotes ('I am a string') or double quotes ("I am a string").
  • You may use special characters within a string by prefacing them with \ (“backslash”)
...