Just published a new blog while learning JavaScript 🚀 While exploring how JavaScript works under the hood, I came across some interesting behavior around var and the Global Object. It led me to dive deeper into globalThis and how JavaScript manages global scope across different environments like Browsers and Node.js. Understanding these small internal concepts really changes how you see JavaScript. If you're learning JavaScript or exploring how it works internally, you might find this useful. 🔗 Read here: https://lnkd.in/geFtZqMf Big thanks to the people and communities that keep sharing knowledge and making the learning journey easier 🙌 Chai Aur Code Hitesh Choudhary Piyush Garg Anirudh J. Akash Kadlag Consistency is key. Still learning, still building. #javascript #webdevelopment #learninginpublic #100daysofcode #developers
Understanding JavaScript's Global Scope with var, globalThis and more
More Relevant Posts
-
Most JavaScript developers use things like console, setTimeout, or global variables every day… But have you ever wondered where they actually come from? 🤔 While learning more about JavaScript internals, I discovered something interesting about the global object and the difference between global and globalThis. The confusing part is that JavaScript runs in multiple environments: • Browsers use window • Node.js uses global • Web Workers use self So how do modern JavaScript libraries write code that works everywhere? That’s where globalThis comes in. I wrote a blog explaining: • What the JavaScript global object really is • The difference between global, window, and globalThis • Why globalThis was introduced in ES2020 • Simple examples + diagrams to make it easy to understand If you're learning JavaScript or want to understand what’s happening behind the scenes, this will help. Read the full blog here 👇 https://lnkd.in/gWT7QjDB #javascript #webdevelopment #nodejs #coding #learninpublic #developers
To view or add a comment, sign in
-
-
My JavaScript Learning Journey Focused on one of the most powerful parts of JavaScript: Functions & Array Methods Here’s what I learned : ✅ Function Fundamentals Understanding parameters, arguments, and how functions help create reusable code. ✅ Arrow Functions (ES6) A cleaner and modern way to write functions in JavaScript. ✅ Methods vs Functions Learning how methods are tied to objects like arrays and strings. ✅ Higher-Order Functions Functions that can take other functions as arguments or return them. ✅ Essential Array Methods • map() → Transform data • filter() → Select specific elements • reduce() → Convert an array into a single value These methods are widely used in modern JavaScript and React development, and mastering them makes code cleaner and more efficient. Consistency > Perfection. If you're also learning JavaScript, let's connect and grow together! 🚀 #JavaScript #WebDevelopment #CodingJourney #LearningInPublic #FullStackDeveloper #100DaysOfCode
To view or add a comment, sign in
-
-
When I first started learning #JavaScript, I made a lot of mistakes. Not because JavaScript is hard — but because I was learning it the wrong way. If you’re starting your JavaScript journey, try to avoid🛑 these 3 common mistakes: 1️⃣. Jumping straight into frameworks** Many beginners start with #React, #Next.js, or other frameworks without understanding core JavaScript. Frameworks are built **on top of JavaScript**. If your basics are weak, everything will feel confusing. Start with fundamentals: Variables, Functions, Arrays, Objects, Closures, Promises, and the DOM. 2️⃣. Watching videos tutorials without mentorship ** Watching 10 hours of tutorials feels productive… but it’s not the same as practising Real learning happens when you: * write code * break things * debug errors * build small projects Code along. Then try building the same thing 3️⃣. Trying to memorize everything** You don’t need to remember every method or syntax. Great developers don’t memorize everything. They understand concepts and know **how to find answers**. Focus on understanding *why things work*, not just *how to write them*. If you avoid these three mistakes early, your JavaScript journey becomes much easier. What mistake did you make when learning JavaScript? #javascript #webdevelopment #coding #programming #frontend #learnjavascript
To view or add a comment, sign in
-
Today’s Learning – JavaScript Array Methods Today I learned about Array Methods in JavaScript. Arrays are very powerful because they allow us to store multiple values in a single variable, and array methods help us work with that data easily. Some methods I practiced today: push() – adds a new element at the end of an array pop() – removes the last element from an array shift() – removes the first element unshift() – adds a new element at the beginning map() – creates a new array by transforming elements filter() – creates a new array with elements that match a condition forEach() – loops through each element in the array Learning these methods helps me write cleaner and shorter code in JavaScript. I am currently improving my JavaScript fundamentals step by step as part of my Frontend Developer learning journey. #JavaScript #WebDevelopment #FrontendDevelopment #CodingJourney
To view or add a comment, sign in
-
Frontend Learning — Understanding Event Loop in JavaScript JavaScript is single-threaded, but still handles async tasks like APIs, timers, and promises smoothly — thanks to the Event Loop. -> So how does it actually work? 1️⃣ Call Stack – Executes synchronous code line by line 2️⃣ Web APIs – Handles async tasks (setTimeout, fetch, etc.) 3️⃣ Callback Queue – Stores callbacks from async operations 4️⃣ Microtask Queue – Stores promises (.then, catch) 5️⃣ Event Loop – Decides what runs next -> Execution Priority: First → Call Stack Then → Microtasks (Promises) Then → Macrotasks (setTimeout, setInterval) -> Why this matters: Understanding this helps you debug async issues, optimize performance, and write predictable code. -> Key Takeaway: Promises always execute before setTimeout (even with 0 delay). #JavaScript #FrontendDevelopment #WebDevelopment #AsyncJavaScript #EventLoop #CodingTips #LearnInPublic #DeveloperJourney
To view or add a comment, sign in
-
-
📢 Just Published a New Blog! I’ve written a beginner-friendly guide on JavaScript Arrays 💻 In this article, I cover the fundamentals like: ✅ Creating arrays ✅ Accessing elements using index ✅ Updating values ✅ Looping through arrays A small step forward in my Web Development journey 📚 🔗 Read it here: https://lnkd.in/gPWCEUZ4 #JavaScript #WebDevelopment #Coding #LearnInPublic
To view or add a comment, sign in
-
Frontend Learning — Stale Closures in JavaScript Ever logged a value inside setTimeout or an async function… and got something unexpected? That’s because of stale closures — one of the most common (and confusing) issues in JavaScript. -> Why this happens: Functions capture variables at the time they are created They don’t automatically get the latest updated value Async operations (like setTimeout) expose this issue more clearly -> Key Takeaway: If your function runs later, it might use old (stale) data instead of the latest value. Mastering closures = fewer bugs + better async logic. #JavaScript #FrontendDevelopment #Closures #AsyncJavaScript #WebDevelopment #CodingTips #LearnInPublic #DeveloperJourney
To view or add a comment, sign in
-
-
JavaScript vs TypeScript: The Ultimate Developer Showdown JavaScript is that easy-going friend who says, “Relax… we’ll handle errors later!” TypeScript? The strict one: “No types, no entry!” JavaScript (JS) Fast, flexible, beginner-friendly. Great for quick projects… but errors may pop up unexpectedly. TypeScript (TS) JavaScript + types = safer code. Catches mistakes early and keeps large projects clean. Simple Truth: JS = Freedom TS = Safety Final Thought: JS feels like coding with full confidence… until it breaks. TS feels strict at first… but saves hours later. Both are powerful — Just choose based on your project size and sanity level. #JavaScript #TypeScript #Developers #Coding #Tech #MERN #Website #MobileApp #AI #Programming
To view or add a comment, sign in
-
-
🚀 Day 40/50 – Promises in JavaScript Today I learned about Promises in JavaScript, which help handle asynchronous operations more effectively. 🔹 A Promise represents a value that may be available now, later, or never. 🔹 It helps avoid callback nesting and makes code cleaner. 📌 Promise States ⏳ Pending – initial state ✅ Fulfilled – operation completed successfully ❌ Rejected – operation failed 📌 Creating a Promise let myPromise = new Promise(function(resolve, reject){ let success = true; if(success){ resolve("Operation Successful"); } else { reject("Operation Failed"); } }); 📌 Using .then() and .catch() myPromise .then(function(result){ console.log(result); }) .catch(function(error){ console.log(error); }); 📌 Promise with setTimeout Example function getData(){ return new Promise(function(resolve){ setTimeout(function(){ resolve("Data received"); }, 2000); }); } getData().then(function(data){ console.log(data); }); 💡 Key Learnings: ✅ Promises handle asynchronous operations ✅ .then() handles success ✅ .catch() handles errors ✅ Avoids callback nesting Thanks for Mentors 10000 Coders Raviteja T Abdul Rahman#Day40 #50DaysOfCode #JavaScript #Promises #AsyncJavaScript #WebDevelopment #CodingJourney
To view or add a comment, sign in
-
🚀 Just launched a small project to demonstrate JavaScript library usage and practical examples for developers. While learning or working with JavaScript libraries, one common challenge is finding clear and simple usage examples. Many developers spend time searching documentation just to understand how to integrate a library. So I built a simple demo site that shows how to use JavaScript libraries with real examples. 👉 Explore the project: https://lnkd.in/gg_fU8EB What this project focuses on • Practical examples of using JavaScript libraries • Simple and easy-to-understand implementation • Developer-friendly structure for experimentation • A quick reference for integrating libraries into web projects JavaScript libraries play a huge role in modern web development by helping developers build features faster and reuse tested functionality rather than writing everything from scratch. (arXiv) This project is part of my effort to build useful developer tools and learning resources while exploring new ideas around automation, testing, and developer productivity. If you're a developer, student, or someone exploring JavaScript libraries, I’d love your feedback. Let me know what libraries or examples you would like to see added next. #JavaScript #WebDevelopment #DeveloperTools #Frontend #Programming #Coding #OpenSource #LearningInPublic #BuildInPublic
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