<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Syed Mohd Abbas's team blog]]></title><description><![CDATA[Syed Mohd Abbas's team blog]]></description><link>https://javascript-by-abbas.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 22 Oct 2026 03:25:51 GMT</lastBuildDate><atom:link href="https://javascript-by-abbas.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[You don't know array in javaScript]]></title><description><![CDATA["Ever wondered why 'holes' can be quite expensive in JavaScript" When we work with JavaScript arrays, it's common to think of them as straightforward data…]]></description><link>https://javascript-by-abbas.hashnode.dev/you-dont-know-array-in-javascript</link><guid isPermaLink="true">https://javascript-by-abbas.hashnode.dev/you-dont-know-array-in-javascript</guid><category><![CDATA[JavaScript]]></category><category><![CDATA[array]]></category><category><![CDATA[coding]]></category><dc:creator><![CDATA[Syed Mohd Abbas]]></dc:creator><pubDate>Tue, 10 Oct 2023 15:39:32 GMT</pubDate><content:encoded><![CDATA[<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=ZRS485LxX0s&amp;t=83s">https://www.youtube.com/watch?v=ZRS485LxX0s&amp;t=83s</a></div>
<p> </p>
<p>"Ever wondered why 'holes' can be quite expensive in JavaScript"</p>
<p>When we work with JavaScript arrays, it's common to think of them as straightforward data structures. But beneath the surface, there's a world of engineering that determines how arrays operate efficiently. In this article, we'll explore two essential concepts: Packed_Element arrays and Holey arrays, and we'll delve into how V8, the JavaScript engine, optimizes arrays based on data types.</p>
<p><strong>1. Packed_Element Arrays:</strong></p>
<p>Packed_Element arrays, also known as dense arrays, are what we typically envision when we think of arrays. These arrays store elements in contiguous memory locations, making them efficient for access and iteration. Each element in a packed array has a numeric index, and there are no gaps between elements.</p>
<p><strong>2. Holey Arrays:</strong></p>
<p>Holey arrays, on the other hand, introduce gaps or "holes" between elements. These gaps occur when elements are deleted or when arrays are created with a specific length but not all indices are filled. While holey arrays are less memory-efficient, they are essential for certain use cases.</p>
<p><strong>3. V8 Optimization:</strong></p>
<p>V8, the JavaScript engine used in Google Chrome and Node.js, employs various optimization techniques to enhance array performance. V8 distinguishes between different array types, such as Small Integer (SMI), Doubled, and Packed, and tailors its operations accordingly.</p>
<p>SMI arrays are optimized for small integers, while Doubled arrays are designed for floating-point numbers. Packed arrays are dense arrays with no holes, enabling efficient data access.</p>
<p><strong>Conclusion:</strong></p>
<p>Understanding the engineering behind JavaScript arrays, including packed_element and holey arrays, is crucial for optimizing your code's performance. Additionally, being aware of how V8 handles these arrays based on data types can help you write more efficient JavaScript.</p>
<p>Kudos to Hitesh Choudhary for shedding light on these intricate topics in the world of JavaScript. If you're looking to dive deeper into these concepts, be sure to check out his video.</p>
<p>In your JavaScript journey, remember that a solid understanding of how the language works under the hood empowers you to write more efficient and performant code.</p>
<p>Happy coding!</p>
]]></content:encoded></item></channel></rss>