javascript

String


 

A string is a sequence of characters(text) enclosed within either single (' ') or double (" ") quotes.
 

Strings are immutable, meaning once created, their values cannot be changed. However, various methods allow for manipulation and extraction of substrings, including concatenation, accessing individual characters, substring extraction, searching within strings, and replacing substrings.

Quotes:

A JavaScript string is inside quotes it can either single or double quotes.

 

1. Single Quote:


A JavaScript string is zero or more characters written inside single quote(‘’).

 

Example:
 

// Single Quote
let str = 'learnCoding';

 

2. Double Quote:

A JavaScript string is zero or more characters written inside double quote(“”).

 

Example:

// Double Quote
let str = "LearnCoding";