Day 3 — JavaScript is humbling me in the best way. Started with the basics I thought I already knew. Turns out I knew the syntax but not the why. var vs let vs const — I used to just pick randomly. Now I get why const is default and var is basically legacy. The thing that actually clicked today: arrow functions aren't just shorter syntax. They handle 'this' differently. That's why everyone prefers them in certain situations. Also spent an hour on map, filter, and reduce with real data instead of fake tutorials. Way more useful. Favourite thing I learned: optional chaining (?.) — it's saved me from so many "cannot read property of undefined" errors already. Drop a JavaScript concept below that confused you at first 👇 #javascript #webdevelopment #frontenddeveloper #coding
JavaScript basics and arrow functions clarified
More Relevant Posts
-
🚀 Understanding var, let, and const in JavaScript While learning JavaScript, one of the most important concepts I revisited is the difference between var, let, and const. It may look basic, but it plays a huge role in writing clean and bug-free code. 🔹 var - Function scoped - Can be re-declared and re-assigned - Can cause unexpected bugs due to scope leakage 🔹 let - Block scoped - Cannot be re-declared - Can be re-assigned 🔹 const - Block scoped - Cannot be re-declared or re-assigned - Must be initialized at the time of declaration 💡 One key takeaway: Use const by default, let when values need to change, and avoid var in modern JavaScript. Small concepts like these build a strong foundation for writing better and more predictable code. #JavaScript #WebDevelopment #Frontend #Coding #Learning #MERNStack #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Understanding Template Literals in JavaScript 📖 Read full guide: https://lnkd.in/ghJ6jZRm While working with JavaScript, I explored how Template Literals simplify string handling and improve code readability. 🔍 Old way (messy): "Hello " + name + "!" ✨ New way (clean): Hello ${name}! 💡 Key Benefits: ✔ Easy variable embedding ✔ Multi-line strings ✔ Cleaner, more readable code Small feature, but a big impact in modern JavaScript 🚀 #JavaScript #WebDevelopment #Coding #FrontendDevelopment #LearningJourney #CleanCode
To view or add a comment, sign in
-
-
I used to believe that JavaScript operated with some hidden “thread algorithm” behind the scenes. However, I learned that it doesn't function that way. JavaScript is single-threaded, yet it effectively manages multiple tasks simultaneously through the event loop, not threads. Here's a simplified breakdown: - There’s one main worker (the call stack). - There’s a waiting area (task queues). - There’s a loop that continuously checks what to run next. The core flow looks like this: while (true) { run sync code first if nothing is running: run all microtasks (Promises) then pick one macrotask (timers, I/O) } What surprised me the most is the priority system: Promises always execute before timers. Even a setTimeout(..., 0) has to wait its turn. As for the “threading” aspect? It exists, but not in the way you might expect. The engine (like V8) runs your code in a single thread, while the environment (browser or Node.js) utilizes multiple threads for tasks like network calls and timers. In essence, JavaScript doesn’t schedule threads; it schedules tasks. This shift in perspective can significantly change your understanding of asynchronous code. #javascript #learning #webdevelopment #programming #codewithishwar
To view or add a comment, sign in
-
💡 JavaScript Cheat Sheet: var vs let vs const Understanding the difference between "var", "let", and "const" is one of the first steps to writing better JavaScript code 🚀 Here’s a quick breakdown: 🔹 "var" – function scoped, can be redeclared & updated (avoid in modern JS) 🔹 "let" – block scoped, can be updated but not redeclared 🔹 "const" – block scoped, cannot be reassigned (but objects/arrays can still mutate) 👉 The rule I follow: - Use "const" by default - Use "let" when reassignment is needed - Avoid "var" This small concept can prevent big bugs in real projects 💡 📌 Save this cheat sheet for quick revision! #JavaScript #FrontendDevelopment #WebDevelopment #Coding #100DaysOfCode #LearnToCode
To view or add a comment, sign in
-
-
🚀 JavaScript Event Loop Explained in a Simple Way JavaScript is a single-threaded language, but it still handles asynchronous tasks like API calls, timers, and events very efficiently. This is possible because of something called the Event Loop. Here’s a simple breakdown: 👉 When JavaScript runs code, it first executes everything in the Call Stack (synchronous code). 👉 If it encounters asynchronous tasks (like setTimeout, fetch requests, etc.), they are sent to the Web APIs. 👉 Once those tasks are completed, their callbacks go to the Callback Queue or Microtask Queue. 👉 The Event Loop continuously checks: “If the Call Stack is empty, push tasks from the queues into the Call Stack.” That’s how JavaScript handles async operations without blocking the main thread. 💡 Key takeaway: Even though JavaScript looks synchronous, the Event Loop makes asynchronous behavior possible. Still learning and exploring more core concepts like this every day. #JavaScript #WebDevelopment #Programming #FrontendDevelopment #100DaysOfCode
To view or add a comment, sign in
-
🚀 Dynamic Currying in JavaScript — Why it actually matters At first, currying feels like a trick: sum(1)(2)(3) But the real power isn’t syntax — it’s reusability. 💡 The idea 👉 Fix some arguments now 👉 Reuse the function later 🔧 Example const filter = fn => arr => arr.filter(fn); const filterEven = filter(x => x % 2 === 0); filterEven([1,2,3,4]); // [2,4] Instead of repeating logic everywhere, you create reusable building blocks. ⚡ Real-world uses API helpers → request(baseUrl)(endpoint) Logging → logger("ERROR")(msg) Event handlers → handleClick(id)(event) Validation → minLength(8)(value) 🧠 Key takeaway Currying isn’t about fancy functions. It’s about writing code that is: ✔ Reusable ✔ Composable ✔ Cleaner Libraries like Lodash and Ramda use this pattern heavily. Once this clicks, your approach to writing functions changes completely. #JavaScript #WebDevelopment #FunctionalProgramming #Currying #CleanCode #Frontend #Coding #100DaysOfCode #DeveloperJourney #TechCommunity
To view or add a comment, sign in
-
-
Just published a new blog on Array Flattening in JavaScript 🚀 At first glance, it feels like a small concept… but once you go deeper, it touches recursion, problem-solving, and even interview-level thinking. In this blog, I covered: • What nested arrays actually are (with clear visuals) • Step-by-step thinking behind flattening • Different approaches (flat(), recursion, reduce, iterative) • Common interview scenarios and edge cases If you're learning JavaScript or preparing for interviews, this will be useful 👇 https://lnkd.in/gQgjYv54 #JavaScript #WebDevelopment #FrontendDevelopment #Coding #LearnInPublic #100DaysOfCode #Programming #SoftwareDevelopment
To view or add a comment, sign in
-
🚀 Mastering JavaScript Array Methods Understanding array methods is a game-changer when writing clean, efficient JavaScript code. Here’s a quick breakdown of some essential ones: 🔹 map() – Transforms each element in an array 🔹 forEach() – Executes a function for every element 🔹 filter() – Selects elements based on a condition 🔹 push() & pop() – Add/remove elements from the end 🔹 shift() & unshift() – Add/remove elements from the beginning 🔹 reduce() – Combines elements into a single value These methods help simplify data manipulation and make your code more readable and powerful. Whether you're transforming data, filtering results, or aggregating values, knowing when to use each method can level up your JavaScript skills. 💡 Pro tip: Use map() for transformations and reduce() for calculations or summaries. #JavaScript #WebDevelopment #Coding #Frontend #Programming #DeveloperTips
To view or add a comment, sign in
-
-
🚀 Mastering JavaScript Array Methods Understanding array methods is a game-changer when writing clean, efficient JavaScript code. Here’s a quick breakdown of some essential ones: 🔹 map() – Transforms each element in an array 🔹 forEach() – Executes a function for every element 🔹 filter() – Selects elements based on a condition 🔹 push() & pop() – Add/remove elements from the end 🔹 shift() & unshift() – Add/remove elements from the beginning 🔹 reduce() – Combines elements into a single value These methods help simplify data manipulation and make your code more readable and powerful. Whether you're transforming data, filtering results, or aggregating values, knowing when to use each method can level up your JavaScript skills. 💡 Pro tip: Use map() for transformations and reduce() for calculations or summaries. #JavaScript #WebDevelopment #Coding #Frontend #Programming #DeveloperTips
To view or add a comment, sign in
-
-
Day 5 — #100DaysOfCode Built a Random Color Generator using JavaScript today. ✅ With a simple click, the background color changes dynamically—making the concept of DOM manipulation and event handling more practical and visual. Projects like these make learning more engaging and help connect concepts more clearly. Building, learning, and improving step by step. 🚀 #100DaysOfCode #JavaScript #WebDevelopment #FrontendDevelopment #Projects #Consistency
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