🚀 JavaScript Tip: Mastering Strings in JavaScript ✨
JavaScript offers three ways to work with strings:
1️⃣ Single Quotes (' ')
const name = 'Kavindu';
console.log('Hello, ' + name + '!');
2️⃣ Double Quotes (" ")
const message = " I'm learning JavaScript. ";
console.log(message);
3️⃣ Template Strings (``)
const items = 2;
const total = 28.94;
console.log(`Items (${items}): $${total}`);
Output: Items (2): $28.94
console.log(`This is a
multi-line string.`);
💡 Pro Tip: Use template strings for cleaner, more readable code!
#JavaScript #CodingTips #WebDevelopment
Very helpful
Very informative 👍
Very informative