Strings in javascript

Strings represent text in JavaScript and are immutable. Common methods include length, toUpperCase, toLowerCase, trim, includes, indexOf, slice, substring, split, and replace. Template literals (backticks) make it easy to embed expressions.

Example

const msg = "  Hello JavaScript!  ";

msg.trim();                  // "Hello JavaScript!"
msg.toUpperCase();           // "  HELLO JAVASCRIPT!  "
msg.includes("Java");        // true
msg.slice(2, 7);             // "Hello"

const name = "Punam";
const greeting = `Hi ${name}!`; // "Hi Punam!"

This shows common string operations: trimming whitespace, changing case, searching for substrings, slicing, and building strings with template literals.