🚀 Day 28 of My Backend Development Journey Today I explored EJS (Embedded JavaScript Templates) — a simple yet powerful templating engine used in Node.js to create dynamic web pages. 🧠 What I learned: EJS allows embedding JavaScript directly into HTML. It’s mostly used with Express.js for rendering server-side views. Tags like <%= %> and <% %> make it easy to display variables, run loops, and conditionals. Perfect for generating dynamic content like user profiles, dashboards, etc. 💡 Example: <h1>Welcome <%= user.name %></h1> This small snippet dynamically displays user data inside HTML — simple and clean! Every day I’m realizing how powerful backend technologies are when combined with templating engines like EJS. #BackendDevelopment #NodeJS #ExpressJS #EJS #WebDevelopment #100DaysOfCode #LearningJourney
Exploring EJS for Dynamic Web Pages with Node.js
More Relevant Posts
-
JavaScript Methods You Must Know as a Developer-- JavaScript methods are the building blocks that make coding efficient and powerful. From working with strings and arrays to handling objects, these methods simplify our daily development tasks. Some must-know JS methods include: - map(), filter(), reduce() for arrays - toUpperCase(), slice(), replace() for strings - Object.keys(), Object.values() for objects Understanding these methods will help you write cleaner, faster, and smarter code. Which JavaScript method do you use the most in your projects? Follow me for more web dev simplified. #JavaScriptTips #JSTricks #JavaScriptDeveloper #JSMethods #WebDevCommunity
To view or add a comment, sign in
-
𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗠𝗲𝘁𝗵𝗼𝗱𝘀 𝗬𝗼𝘂 𝗠𝘂𝘀𝘁 𝗞𝗻𝗼𝘄 𝗮𝘀 𝗮 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗲𝗿 JavaScript methods are the building blocks that make coding efficient and powerful. From working with strings and arrays to handling objects, these methods simplify our daily development tasks. Some must-know JS methods include: - map(), filter(), reduce() for arrays - toUpperCase(), slice(), replace() for strings - Object.keys(), Object.values() for objects Understanding these methods will help you write cleaner, faster, and smarter code. Which JavaScript method do you use the most in your projects? Follow me for more web dev simplified. 𝗜 𝗵𝗮𝘃𝗲 𝗰𝗿𝗲𝗮𝘁𝗲𝗱 𝗮 𝗖𝗼𝗺𝗽𝗹𝗲𝘁𝗲 𝗜𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄 𝗣𝗿𝗲𝗽 𝗚𝘂𝗶𝗱𝗲 (𝘄𝗶𝘁𝗵 𝗰𝗮𝗻'𝘁 𝗔𝘃𝗼𝗶𝗱 𝗤𝘂𝗲𝘀𝘁𝗶𝗼𝗻𝘀)— covering JavaScript, React, Next.js, System Design, and more. 𝗚𝗲𝘁 𝘁𝗵𝗲 𝗚𝘂𝗶𝗱𝗲 𝗵𝗲𝗿𝗲- https://lnkd.in/gFmw8w6W If you've read so far, do LIKE and RESHARE the post👍 #JavaScriptTips #JSTricks #JavaScriptDeveloper #JSMethods #WebDevCommunity
To view or add a comment, sign in
-
Day 8 of #React30 💡 JSX - The Secret Sauce of React Components 🧩 Ever wondered why React uses something that looks like HTML inside JavaScript? ⭐That’s JSX - and it’s what makes React code powerful yet easy to read. JSX stands for JavaScript XML, and it lets you write HTML-like syntax directly in JS, which Babel then converts into standard JavaScript that browsers can understand. ⭐JSX looks like HTML inside JavaScript... But it’s actually neither HTML nor just JS. It’s a syntax extension that makes UI logic readable 🧠 The Real Flow: 💡 JSX → React.createElement → React Element → HTML 🧠 Why React Uses JSX ✅ Easier to visualize UI structure ✅ Lets you write logic + layout together ✅ Helps React create Virtual DOM elements efficiently ✅ Cleaner and more readable than React.createElement() calls 💻 Example: function Greet() { return <h1>Hello React! ⚛️</h1>; } 🧠 Transpiled version: React.createElement("h1", null, "Hello React! ⚛️"); That’s how React builds the Virtual DOM nodes faster JSX is just syntactic sugar for JavaScript! 💡 Key Takeaway: JSX bridges the gap between design and logic you write code that looks like UI, but runs like JavaScript ⚡ 🎯 Mini Challenge: Can you add a <p> tag in the above code that shows the current date dynamically? #ReactJS #React30 #FrontendDevelopment #WebDev #JavaScript #JSX #ReactComponents
To view or add a comment, sign in
-
I bet you don’t know this about console.log() For a long time, I believed console.log() was a built-in feature of JavaScript. It turns out that it isn’t. It’s not defined in the core JavaScript specification at all. console.log() actually comes from the environment where JavaScript runs. When you run code in a browser or in Node.js, it’s the environment that provides access to it. JavaScript itself is just the language. It defines things like variables, arrays, objects, loops, functions, and promises. That is what ECMAScript standardizes. When JavaScript runs in a browser, it also gets access to Web APIs. These are extra tools that the browser provides so JavaScript can interact with the web page, the user, and the network. That’s where features like document, fetch, setTimeout, and console.log() come from. When JavaScript runs in Node.js, it does not have window or document. Instead, it provides its own modules such as fs, path, process, and require. Node.js also includes its own version of console.log(). Once I understood this, it completely changed how I see JavaScript. It is not just one thing. It is the language combined with the environment it runs in. Knowing this difference helps you debug better, switch smoothly between frontend and backend, and really understand how JavaScript works behind the scenes. It is a small detail, but once you notice it, you start seeing JavaScript in a completely new way. 📝If you want more content like that then follow Faizan Ali #javascript #developer #frontend #backend
To view or add a comment, sign in
-
-
Why do we need async/await in JavaScript? Async/await is a major source of confusion in JavaScript. People tend just to add and remove the async and await keywords until the code works (or seems to work). In this article, I want to explain what async/await actually means by developing the concept from vanilla, synchronous JavaScript to asynchronous JavaScript with the async/await syntax sugar. It is my personal take on the subject. I hope some will find it interesting. Disclaimer: I use Node.js as an example of a JavaScript runtime in this article. However, what's discussed also applies to other runtimes like web browser JS engines. All these environments follow similar architectures. Suppose you have a function that does some I/O. function handleRequest() { try { const data = doDatabaseQuery(); const fileName = doElasticsearchQuery(data); const result = readMyFile(fileName); return result; } catch (err) { return handleError(err); } } Here we assume that the query functions and the readMyFile functio https://lnkd.in/gkSCJnHx
To view or add a comment, sign in
-
The Language Behind the Web: How JavaScript Works! JavaScript is the language behind the web, powering almost everything you see and interact with online. But beyond the code we write, there’s a complex system at work, parsing, compiling, and executing every instruction with precision. In this blog, we’ll explore how JavaScript truly works under the hood: how the engine runs your code, manages execution, handles asynchronous tasks, and cleans up memory. Understanding these internals will help you write smarter, more efficient code and see JavaScript from a whole new perspective. At its core, JavaScript is a single-threaded, interpreted (or just-in-time compiled) language that powers interactivity on the web. Being single-threaded, JavaScript executes one task at a time in a single main thread. Yet, it can handle network requests, animations, and user interactions without freezing the page. This is possible because, while JavaScript itself is synchronous, it achieves asynchronous behavior through callbacks, promises, and the event loop. https://lnkd.in/g_qzf-ew
To view or add a comment, sign in
-
The Language Behind the Web: How JavaScript Works! JavaScript is the language behind the web, powering almost everything you see and interact with online. But beyond the code we write, there’s a complex system at work, parsing, compiling, and executing every instruction with precision. In this blog, we’ll explore how JavaScript truly works under the hood: how the engine runs your code, manages execution, handles asynchronous tasks, and cleans up memory. Understanding these internals will help you write smarter, more efficient code and see JavaScript from a whole new perspective. At its core, JavaScript is a single-threaded, interpreted (or just-in-time compiled) language that powers interactivity on the web. Being single-threaded, JavaScript executes one task at a time in a single main thread. Yet, it can handle network requests, animations, and user interactions without freezing the page. This is possible because, while JavaScript itself is synchronous, it achieves asynchronous behavior through callbacks, promises, and the event loop. https://lnkd.in/g_qzf-ew
To view or add a comment, sign in
-
JavaScript doesn’t wait for anything… yet somehow, everything still gets done 😎 Ever wondered how? Master behind the screens — Promises 🔥 In JavaScript, a Promise is like saying — “I don’t have the answer yet, but I’ll get back to you once I do.” It helps JS handle async operations like fetching data, API calls, timers, and more — without blocking the main thread. let's check the below code 👇 const getData = new Promise((resolve, reject) => { const success = true; success ? resolve("✅ Data fetched") : reject("❌ Failed"); }); getData .then(res => console.log(res)) .catch(err => console.log(err)) .finally(() => console.log("Operation complete")); When you run this: First, the promise is pending ⏳ Then it becomes fulfilled ✅ or rejected ❌ But there’s more — Promises can work together too 👇 Promise.all() → Waits for all to finish (fails if one fails) Promise.allSettled() → Waits for all, even if some fail Promise.race() → Returns the fastest one to settle 🏁 Promise.any() → Returns the first successful one 🎯 In short Promises don’t make JavaScript faster. They make it smarter — letting your code do more while waiting for results 💪 #JavaScript #WebDevelopment #Frontend #MERNStack #AsyncProgramming #NodeJS #ReactJS #CodingTips #SoftwareEngineering
To view or add a comment, sign in
-
🌟 Day 10: Introduction to Asynchronous JavaScript 🚀 “JavaScript doesn’t wait… it multitasks!” 🔹 Synchronous vs Asynchronous JavaScript 🧩 Synchronous JS → Executes line by line, one task at a time. 🌀 Asynchronous JS → Can perform multiple tasks without waiting for one to finish. --- ⚡ Example: console.log("1️⃣ Start"); setTimeout(() => { console.log("2️⃣ Async Task (after 2s)"); }, 2000); console.log("3️⃣ End"); 🧠 Output: 1️⃣ Start 3️⃣ End 2️⃣ Async Task (after 2s) 👉 Even though the timeout is written second, it executes later because it’s asynchronous. --- 💡 Why it matters? Asynchronous JavaScript makes web apps fast, responsive, and user-friendly — essential for tasks like: Fetching data from APIs Handling user events Running background operations
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development