Going back to basics 🌱 What does "typeof null" returns ?? Surprisingly, it returns "object" Yes it has been a "bug" in Javascript since the very beginning as i have read. When Javascript was first designed, values were stored in a way that caused "null" to be mistakenly tagged as an "object". And even after years, it remains that way for backward compatibility. So, "typeof null" is "object" but null is not an "object". #Javascript #Frontend
Ravi Shankar Pratihast’s Post
More Relevant Posts
-
💡 JavaScript Tip: Choose Immutability! Working with arrays and objects in JS? Using immutable patterns makes your code safer, more predictable, and React-friendly. Here’s a complete cheat sheet: ✨ Why immutability matters: Prevents unexpected side-effects Easier debugging & testing Supports React reconciliation – React relies on object/array references to detect changes efficiently. Immutable updates make re-renders predictable and fast. #JavaScript #WebDevelopment #ReactJS #CodingTips #CleanCode #Frontend #ReactReconciliation
To view or add a comment, sign in
-
-
Today I learned about three important JavaScript loops: forEach() for...in for...of Each one has its own purpose: forEach() — used to loop through array elements for...in — used to iterate over object keys for...of — used to loop through iterable values like arrays or strings Understanding the difference between them really cleared things up for me 💡 #JavaScript #WebDevelopment #LearningJourney #Frontend #100daysofcode
To view or add a comment, sign in
-
🎯 Practiced JavaScript DOM today learned how to manipulate multiple elements and how JS interacts with each node in real time. It’s amazing how small scripts can change an entire webpage dynamically! 💻 Check it out here 👉 https://lnkd.in/g9cWfhaH #JavaScript #WebDevelopment #Frontend #LearningJourney
To view or add a comment, sign in
-
-
Top-level await in JavaScript. In short: Top-level await turns modules into truly asynchronous building blocks — letting JavaScript handle async dependencies naturally, such as an HTTP request for data from the backend. #JavaScript #WebDevelopment #Frontend
To view or add a comment, sign in
-
-
A closure in JavaScript is when a function remembers and accesses variables from its outer scope, even after that outer function has returned. #javascript #typescript #frontend #backend
To view or add a comment, sign in
-
-
Daily Tip: JavaScript or React — Elevate your skills with 1 practical tip a day. Today's focus: mastering closures in JavaScript to write clean, maintainable code. Pro tip: when a closure closes over a variable, ensure you understand the scope chain to prevent leaks. #JavaScript #React #codingtips #webdev
To view or add a comment, sign in
-
🚀 𝐔𝐧𝐝𝐞𝐫𝐬𝐭𝐚𝐧𝐝𝐢𝐧𝐠 𝐅𝐚𝐥𝐬𝐲 𝐕𝐚𝐥𝐮𝐞𝐬 𝐢𝐧 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭 In JavaScript, some values are considered “falsy”, meaning they behave like false when used in a condition. Falsy values are: 𝐟𝐚𝐥𝐬𝐞, 0, "", 𝐮𝐧𝐝𝐞𝐟𝐢𝐧𝐞𝐝, 𝐧𝐮𝐥𝐥, 𝐍𝐚𝐍 💡 Tip: Any value that’s not falsy is automatically 𝐭𝐫𝐮𝐭𝐡𝐲 — for example: 'hello', 1, [], {}, true are all 𝐭𝐫𝐮𝐭𝐡𝐲. 👉 JavaScript quietly checks for truthy or falsy behind the scenes! #JavaScript #WebDevelopment #Frontend #CodingTips #LearnJS
To view or add a comment, sign in
-
🚀 Leveling Up My JavaScript Fundamentals! Just revised all the important JavaScript loop types — for, while, do...while, for...in, and for...of. These loops may look similar, but each one solves a different kind of problem efficiently. Understanding when to use which loop makes your code cleaner, faster, and more readable — especially in real projects. 🔥 Sharing this snippet for anyone who wants a quick refresher! #JavaScript #WebDevelopment #Frontend #CodingJourney #LearnToCode #TechCommunity #ReactJS
To view or add a comment, sign in
-
-
🚀 Just finished a small JavaScript project! I built a modal window that opens and closes when clicking buttons, the overlay, or pressing the Escape key. 🧠 This helped me understand: - querySelector / querySelectorAll - addEventListener - classList.add() and .remove() - Keyboard events like keydown Check out the full project on GitHub 👇 🔗 https://lnkd.in/euzZQVBA #JavaScript #WebDevelopment #Frontend #LearningInPublic #Makhilens
To view or add a comment, sign in
-
🚀 Day 3 – Level 3 of my 4 Days JavaScript Challenge! 💡 Today's Topic: Difference between call() and apply() in JavaScript Both are used to set the this context and invoke a function immediately — but the way they pass arguments makes all the difference 👇 🪄 Quick Tip 🔹 Use call() when you already know the exact number of arguments. 🔹 Use apply() when arguments are coming dynamically as an array. #JavaScript #WebDevelopment #CodingChallenge #Frontend #LearnInPublic
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