DEV Community

Cover image for #javascript #apnacollege #webdev #beginners
Ali Hamza
Ali Hamza

Posted on

#javascript #apnacollege #webdev #beginners

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.`);
Enter fullscreen mode Exit fullscreen mode

Top comments (0)