English
Open in Telegram

Post 🔹 Escape Characters

26 September 2026
W
Web 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:\tRahul"; console.log(message2); // Name: Rahul (with tab) 🔹 Comparing Strings 2️⃣6️⃣ String Comparison Strings can be compared: console.log("apple" === "apple"); // true console.log("Apple" === "apple"); // false - case-sensitive const input = "ADMIN"; if (input.toLowerCase() === "admin") { console.log("Access granted"); } ⭐ Practical String Processing Imagine a user enters an email: const input = " [email protected] "; const email = input.trim().toLowerCase(); console.log(email); // [email protected] if (email.includes("@")) { console.log("Email looks valid"); } This combines: • trim() ↓ toLowerCase() ↓ includes() 🧠 Real-World Example Suppose you receive this data: const data = "Amit, Priya, Rahul, Neha"; const names = data.split(","); const cleanedNames = names.map(name => name.trim()); console.log(cleanedNames); // ["Amit", "Priya", "Rahul", "Neha"] const filteredNames = cleanedNames.filter( name => name.startsWith("R") ); console.log(filteredNames); // ["Rahul"] ⚠️ Common Beginner Mistakes • Mistake 1: Forgetting that strings are zero-indexed const word = "Hello"; console.log(word[0]); // H not e • Mistake 2: Expecting string methods to modify the original string const name = "rahul"; name.toUpperCase(); console.log(name); // still "rahul" const upperName = name.toUpperCase(); // correct • Mistake 3: Forgetting trim() • User input often has accidental spaces: " Rahul " • Mistake 4: Confusing split() and join() • split() → string → array • join() → array → string 💻 Practice • 1️⃣ Reverse a String: Given const word = "JavaScript"; Try to produce tpircSavaJ. Hint: split() + reverse() + join() • 2️⃣ Count Characters: Count characters in "JavaScript" • 3️⃣ Convert to Uppercase: Convert "javascript is powerful" to uppercase. • 4️⃣ Extract Text: From "JavaScript" extract Script • 5️⃣ Replace Text: Convert "I love Python" into "I love JavaScript" • 6️⃣ Clean User Input: Given const input = " HELLO JAVASCRIPT "; Produce hello javascript • 7️⃣ Challenge: Given const email = " [email protected] "; Create a cleaned version that: - Removes extra spaces - Converts everything to lowercase - Checks whether it contains @ - Prints "Valid email format" if it does. 🧠 Double Tap ❤️ For More
6 · 2.2K ·

Nearby in the feed

WWeb 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 = "PuWWeb Development - HTML, CSS & JavaScriptconst fileName = "report.pdf"; console.log(fileName.endsWith(".pdf")); // true 🔹 Finding Positions 1️⃣3️⃣ indexOf() Returns the position of the first occurrence
this message
WWeb Development - HTML, CSS & JavaScript10 Websites Every Developer & AI Enthusiast Should Bookmark ✅ roadmap.sh – Step-by-step learning paths for devs ✅ paperswithcode.com – Browse ML research with cWWeb Development - HTML, CSS & JavaScriptTo learn web design and development from basic to advanced levels, you can follow these steps: 🤩🤩 ⏩ HTML and CSS: Start with the basics of HTML (Hypertext Marku
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