Hello Dev Community! π
It is officially Day 12 of my journey to master the MERN stack! Today, I wrapped up Lecture 3 of Apna College's JavaScript playlist with Shradha Didi, focusing on a fundamental data type we use every day: Strings.
Before today, I thought strings were just plain text wrapped in quotes. Today, I learned how much power JavaScript gives us to manipulate, slice, and dynamically format text.
π§ Key Learnings From JS Lecture 3 (Strings)
I explored how JavaScript handles text strings and the built-in properties and methods that make text manipulation effortless:
1. Template Literals (The Ultimate Game Changer)
Shradha Didi introduced Template Literals, which use backticks (`) instead of standard quotes. This allows us to perform String Interpolationβembedding variables directly inside a string using ${variable}. It makes code look clean and professional:
javascript
let obj = { item: "pen", price: 10 };
// Old way: console.log("The cost of", obj.item, "is", obj.price, "rupees.");
// Modern way:
console.log(`The cost of ${obj.item} is ${obj.price} rupees.`);
Top comments (0)