Data MasteryFriday, January 23, 2026

Strings & Template Literals

Manipulating text like a pro.

Advertisement

Support JS Mastery Path by checking out our sponsors.

Strings are immutable sequences of characters. You can't change a character in place, you must create a new string.

Template Literals

const tool = "JS";
// Modern interpolation
console.log(`I love ${tool} because it's everywhere.`);

Manipulation Power Moves

The split and join combo is extremely powerful for transforming text.

const sentence = "hello-world-from-js";

// 1. Split into array
const words = sentence.split("-"); 
console.log(words); // ["hello", "world", "from", "js"]

// 2. Modify array (Capitalize first word)
words[0] = words[0].toUpperCase();

// 3. Join back together
const newSentence = words.join(" ");
console.log(newSentence); // "HELLO world from js"
Advertisement

Support JS Mastery Path by checking out our sponsors.