Just published a deep dive into how V8 handles arrays under the hood 🚀 Key takeaway: not all arrays are equal. Packed arrays (SMI/Double) and TypedArrays are highly optimized, while holey and mixed arrays introduce hidden performance costs due to extra checks and de-optimizations. If you're writing performance-critical JavaScript, these low-level details *matter more than you think*. I’ve also included a benchmark to see the differences yourself 👇 https://lnkd.in/gsxGFNZv #JavaScript #V8 #Performance #NodeJS #Programming
V8 Array Performance Optimizations
More Relevant Posts
-
A React component is a function which returns JSX. When you use that component inside another component, the React creates an element. <Ali /> refers to element of Ali component. So, when React sees <Ali /> it gets it's JSX and internally call React.createElement with details of Ali component such as props, key and children. React.createElement creates an object which is basically description of what needs to be rendered. Then React adds that to the virtual DOM and gets added to real DOM. Tried my best to simplify this concept. Thinking of writing a blog on it. You can subscribe to my newsletter to read in-depth. link in comment. #react #javascript #frontend #programming
To view or add a comment, sign in
-
Most developers get this WRONG 😅 What will be the output? console.log(1); setTimeout(() => console.log(2), 0); Promise.resolve().then(() => console.log(3)); console.log(4); 👇 Drop your answer before checking Understanding Event Loop = Next Level JavaScript 🚀 #JavaScript #CodingChallenge #FrontendDeveloper #TechCommunity #Programming #DevelopersIndia #LearnJS
To view or add a comment, sign in
-
-
JavaScript is single threaded, but handles async operations so smoothly 👇 That’s where the Event Loop comes in. At first, things seem simple: • Code runs line by line But then you see behavior like this: Even with 0ms, the timeout doesn’t run immediately. Because JavaScript uses: ✔ Call Stack ✔ Web APIs ✔ Callback Queue ✔ Event Loop Understanding this changed how I think about async code and debugging. Sometimes the delay isn’t about time, it’s about how the event loop schedules execution. #JavaScript #EventLoop #AsyncJavaScript #FrontendDevelopment #Programming
To view or add a comment, sign in
-
-
Just realized something interesting about JavaScripts memory optimisation behaviour with primitives while digging into runtime behavior 👇 Values like true, false, undefined, null, and even common string literals (like "") aren’t recreated every time you declare them. JS engines (like V8) treat these as shared, immutable values: • They exist only once internally • Variables just hold references to them So when you write: let a = true; let b = true; You’re not creating two true values — both just point to the same underlying value. Same idea applies to: • false • undefined • null • frequently used string literals 👉 Small detail, but shows how much memory optimization happens under the hood, a neat reminder that JavaScript does more for performance than we often think. #JavaScript #V8 #Performance #Programming #Backend
To view or add a comment, sign in
-
Ever wondered why JavaScript shows “undefined” even before a variable is assigned? 🤯 console.log(a); var a = 10; At first glance, this feels confusing… But the answer lies in one powerful concept: 👉 Execution Context Here’s what actually happens behind the scenes: ⚡ When JavaScript runs your code, it creates an Execution Context ⚡ In the memory phase, variables are hoisted → initialized as undefined ⚡ In the execution phase, code runs line by line and values get assigned I made a short video explaining the basics—would love your feedback 🙌 #javascript #webdevelopment #frontend #programming #coding #developers #learntocode #100daysofcode
To view or add a comment, sign in
-
💡 What is Ternary Operator in React? The ternary operator is used for conditional rendering in React. 👉 Syntax: condition ? trueValue : falseValue 📌 Example Use Cases: • Show / hide elements • Login / Logout button • Loading states • Toggle UI 📌 Why use it? • Cleaner than if-else • Inline rendering • Easy to read ⚡ Helps you write dynamic UI logic directly in JSX. Master this to build smart React interfaces. Follow TFSC for practical frontend learning. #reactjs #ternaryoperator #frontenddevelopment #javascript #webdevelopment #coding #learnreact #programming #tfsc
To view or add a comment, sign in
-
Closures look confusing at first, but the core idea is simple: A closure is when a function remembers variables from the scope where it was created, even after that outer function has finished running. That is why closures are so useful for private state, counters, factories, and callbacks. The infographic breaks it down visually: create a variable, return an inner function, and that inner function keeps access to the remembered value. If you understand this, a lot of JavaScript starts making more sense. What JavaScript concept should I simplify next? #JavaScript #Closures #WebDevelopment #FrontendDevelopment #Programming #LearnToCode #ReactJS #SoftwareEngineering
To view or add a comment, sign in
-
-
Practiced some core JavaScript basics today using problems from GeeksforGeeks: • Odd & even count • Average of array • Palindrome check • Vowel count • Perfect square check • Max in matrix • Sum of digits Focused on understanding the logic and trying different approaches. Source:https://lnkd.in/dttvtZdp #JavaScript #Coding #Learning
To view or add a comment, sign in
-
💡 JavaScript Challenge function sum(a, b) { return a + b; } function sumCurried(a) { return function(b) { return a + b; }; } console.log(sum(5, 4)); console.log(sumCurried(5)(4)); ❓ What’s the output? Two different approaches… one result. But here’s the real question 👇 Are you more curious about the answer… or how both paths lead there? 👇 Drop your answer below! 🔗 Follow me for more insights on coding, creativity & branding. #JavaScript #WebDevelopment #CodingChallenge #Curiosity #Programming #Developers #LearnToCode
To view or add a comment, sign in
-
-
DOM Manipulation Challenge: Are you doing it WRONG? Let's test your JavaScript logic! 🧠 Look at the code in the image. We added click listeners to 1,000 items. Then, we added a brand new item to the list. Question: When you click that NEW item, what happens in the console? A) "Item clicked!" B) Nothing at all C) Error If you guessed B, you're right! This is why "Event Delegation" is a senior-level skill every developer needs to master. It saves memory and handles new items automatically. 💻✨ Tell me your answer in the comments! 👇 Hashtags: #JavaScript #CodingQuiz #WebDev #100DaysOfCode #LearnToCode #CodeWithSarir #FrontendDevelopment #ProgrammingTips #JSLogic #codinglife #programmer
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