English
Open in Telegram

Post 💻 JavaScript Roadmap 2026 — Part 8

26 September 2026
W
Web Development - HTML, CSS & JavaScript
💻 JavaScript Roadmap 2026 — Part 8 🟢 Strings & String Methods Strings are used to represent text in JavaScript. Examples: const name = "Rahul"; const city = "Pune"; const message = "Welcome to JavaScript"; Strings are used everywhere: • User names • Emails • Search queries • API responses • Messages • URLs • Form inputs • File names Understanding string manipulation is therefore essential. 1️⃣ Creating Strings JavaScript provides three common ways to create strings. • Double quotes: const name = "Rahul"; • Single quotes: const name = 'Rahul'; • Template literals: const name = `Rahul`; Template literals use backticks. They become especially useful when inserting variables into strings. 2️⃣ String Length Use .length to find the number of characters. const message = "JavaScript"; console.log(message.length); // 10 Spaces are also counted. const message = "Hello World"; console.log(message.length); // 11 - space is included 3️⃣ Accessing Characters Strings use zero-based indexing, just like arrays. const language = "JavaScript"; console.log(language[0]); // J console.log(language[4]); // S console.log(language[language.length - 1]); // t - last character 4️⃣ Strings Are Immutable Strings cannot be changed directly. const name = "Rahul"; name[0] = "K"; // Does NOT work Instead, you create a new string: const name = "Rahul"; const updatedName = "K" + name.slice(1); console.log(updatedName); // Kahul This concept of immutability is important when working with strings. 🔹 Changing Letter Case 5️⃣ toUpperCase() Converts a string to uppercase. const name = "rahul"; console.log(name.toUpperCase()); // RAHUL 6️⃣ toLowerCase() Converts a string to lowercase. const name = "RAHUL"; console.log(name.toLowerCase()); // rahul A common real-world use: const userInput = "ADMIN"; if (userInput.toLowerCase() === "admin") { console.log("Admin user"); } 🔹 Removing Unwanted Spaces 7️⃣ trim() trim() removes whitespace from the beginning and end of a string. const name = " Rahul "; console.log(name.trim()); // Rahul This is extremely useful when processing form inputs. 8️⃣ trimStart() Removes whitespace from the beginning. const text = " Hello"; console.log(text.trimStart()); // "Hello" 9️⃣ trimEnd() Removes whitespace from the end. const text = "Hello "; console.log(text.trimEnd()); // "Hello" 🔹 Searching Strings 🔟 includes() Checks whether a string contains specific text. const message = "Welcome to JavaScript"; console.log(message.includes("JavaScript")); // true const email = "[email protected]"; console.log(email.includes("@")); // true 1️⃣1️⃣ startsWith() Checks whether a string starts with specific text. const url = "https://example.com"; console.log(url.startsWith("https")); // true 1️⃣2️⃣ endsWith() Checks whether a string ends with specific text.
7 · 1.2K ·

Nearby in the feed

WWeb Development - HTML, CSS & JavaScript🚀 𝗧𝗼𝗽 𝟳 𝗙𝗥𝗘𝗘 𝗠𝗶𝗰𝗿𝗼𝘀𝗼𝗳𝘁 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 𝘁𝗼 𝗟𝗲𝗮𝗿𝗻 𝗗𝗮𝘁𝗮 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀! 📊 Want to start a career in Data Analytics? Explore these 7 free Microsoft-backed learning resources covWWeb Development - HTML, CSS & JavaScriptThe best doesn't come from working more. It comes from working smarter. The most common mistakes people make, With practical tips to avoid each: 1) Working late
this message
WWeb Development - HTML, CSS & JavaScriptconst fileName = "report.pdf"; console.log(fileName.endsWith(".pdf")); // true 🔹 Finding Positions 1️⃣3️⃣ indexOf() Returns the position of the first occurrenceWWeb Development - HTML, CSS & JavaScript🔹 Escape Characters 2️⃣5️⃣ New Line You can use \n and \t: const message1 = "Hello\nWorld"; console.log(message1); // Hello // World const message2 = "Name:\tRa
WWeb Development - HTML, CSS & JavaScriptWeb Development - HTML, CSS & JavaScript@javascript_courses · channel · Tech
55 690subscribers1 964average post reach
Venue feed Open in Telegram

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · Index limits · Remove a page · Catalog · Search · How we count