[{"data":1,"prerenderedAt":378},["ShallowReactive",2],{"term-a\u002Farray":3,"related-a\u002Farray":360},{"id":4,"title":5,"acronym":6,"body":7,"category":341,"description":342,"difficulty":343,"extension":344,"letter":345,"meta":346,"navigation":103,"path":347,"related":348,"seo":354,"sitemap":355,"stem":358,"subcategory":6,"__hash__":359},"terms\u002Fterms\u002Fa\u002Farray.md","Array",null,{"type":8,"value":9,"toc":335},"minimark",[10,15,19,23,26,30,324,328,331],[11,12,14],"h2",{"id":13},"eli5-the-vibe-check","ELI5 — The Vibe Check",[16,17,18],"p",{},"An array is a list of things in order, like a numbered row of boxes. Box 0 holds the first item, box 1 holds the second, and so on. Arrays are the most basic data structure and almost every program uses them. You can loop over them, sort them, and access any item instantly by its number.",[11,20,22],{"id":21},"real-talk","Real Talk",[16,24,25],{},"An array is an ordered, indexed collection of elements stored in contiguous memory locations (in low-level languages) or as a dynamic structure (in high-level languages). Arrays provide O(1) random access by index, O(n) search, and O(n) insertion\u002Fdeletion in the middle. In JavaScript, arrays are dynamic and can hold mixed types. In typed languages, arrays are fixed-type.",[11,27,29],{"id":28},"show-me-the-code","Show Me The Code",[31,32,37],"pre",{"className":33,"code":34,"language":35,"meta":36,"style":36},"language-javascript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F JavaScript array operations:\nconst nums = [10, 20, 30, 40, 50];\n\nconsole.log(nums[0]);        \u002F\u002F 10 — index access O(1)\nconsole.log(nums.length);    \u002F\u002F 5\n\nnums.push(60);               \u002F\u002F add to end O(1)\nnums.unshift(0);             \u002F\u002F add to start O(n) — shifts all\nnums.splice(2, 1);          \u002F\u002F remove at index O(n)\n\nconst doubled = nums.map(n => n * 2);   \u002F\u002F transform\nconst evens = nums.filter(n => n % 2 === 0); \u002F\u002F filter\n","javascript","",[38,39,40,49,98,105,133,155,160,185,206,233,238,281],"code",{"__ignoreMap":36},[41,42,45],"span",{"class":43,"line":44},"line",1,[41,46,48],{"class":47},"sHwdD","\u002F\u002F JavaScript array operations:\n",[41,50,52,56,60,64,67,71,74,77,79,82,84,87,89,92,95],{"class":43,"line":51},2,[41,53,55],{"class":54},"spNyl","const",[41,57,59],{"class":58},"sTEyZ"," nums ",[41,61,63],{"class":62},"sMK4o","=",[41,65,66],{"class":58}," [",[41,68,70],{"class":69},"sbssI","10",[41,72,73],{"class":62},",",[41,75,76],{"class":69}," 20",[41,78,73],{"class":62},[41,80,81],{"class":69}," 30",[41,83,73],{"class":62},[41,85,86],{"class":69}," 40",[41,88,73],{"class":62},[41,90,91],{"class":69}," 50",[41,93,94],{"class":58},"]",[41,96,97],{"class":62},";\n",[41,99,101],{"class":43,"line":100},3,[41,102,104],{"emptyLinePlaceholder":103},true,"\n",[41,106,108,111,114,118,121,124,127,130],{"class":43,"line":107},4,[41,109,110],{"class":58},"console",[41,112,113],{"class":62},".",[41,115,117],{"class":116},"s2Zo4","log",[41,119,120],{"class":58},"(nums[",[41,122,123],{"class":69},"0",[41,125,126],{"class":58},"])",[41,128,129],{"class":62},";",[41,131,132],{"class":47},"        \u002F\u002F 10 — index access O(1)\n",[41,134,136,138,140,142,145,147,150,152],{"class":43,"line":135},5,[41,137,110],{"class":58},[41,139,113],{"class":62},[41,141,117],{"class":116},[41,143,144],{"class":58},"(nums",[41,146,113],{"class":62},[41,148,149],{"class":58},"length)",[41,151,129],{"class":62},[41,153,154],{"class":47},"    \u002F\u002F 5\n",[41,156,158],{"class":43,"line":157},6,[41,159,104],{"emptyLinePlaceholder":103},[41,161,163,166,168,171,174,177,180,182],{"class":43,"line":162},7,[41,164,165],{"class":58},"nums",[41,167,113],{"class":62},[41,169,170],{"class":116},"push",[41,172,173],{"class":58},"(",[41,175,176],{"class":69},"60",[41,178,179],{"class":58},")",[41,181,129],{"class":62},[41,183,184],{"class":47},"               \u002F\u002F add to end O(1)\n",[41,186,188,190,192,195,197,199,201,203],{"class":43,"line":187},8,[41,189,165],{"class":58},[41,191,113],{"class":62},[41,193,194],{"class":116},"unshift",[41,196,173],{"class":58},[41,198,123],{"class":69},[41,200,179],{"class":58},[41,202,129],{"class":62},[41,204,205],{"class":47},"             \u002F\u002F add to start O(n) — shifts all\n",[41,207,209,211,213,216,218,221,223,226,228,230],{"class":43,"line":208},9,[41,210,165],{"class":58},[41,212,113],{"class":62},[41,214,215],{"class":116},"splice",[41,217,173],{"class":58},[41,219,220],{"class":69},"2",[41,222,73],{"class":62},[41,224,225],{"class":69}," 1",[41,227,179],{"class":58},[41,229,129],{"class":62},[41,231,232],{"class":47},"          \u002F\u002F remove at index O(n)\n",[41,234,236],{"class":43,"line":235},10,[41,237,104],{"emptyLinePlaceholder":103},[41,239,241,243,246,248,251,253,256,258,262,265,268,271,274,276,278],{"class":43,"line":240},11,[41,242,55],{"class":54},[41,244,245],{"class":58}," doubled ",[41,247,63],{"class":62},[41,249,250],{"class":58}," nums",[41,252,113],{"class":62},[41,254,255],{"class":116},"map",[41,257,173],{"class":58},[41,259,261],{"class":260},"sHdIc","n",[41,263,264],{"class":54}," =>",[41,266,267],{"class":58}," n ",[41,269,270],{"class":62},"*",[41,272,273],{"class":69}," 2",[41,275,179],{"class":58},[41,277,129],{"class":62},[41,279,280],{"class":47},"   \u002F\u002F transform\n",[41,282,284,286,289,291,293,295,298,300,302,304,306,309,311,314,317,319,321],{"class":43,"line":283},12,[41,285,55],{"class":54},[41,287,288],{"class":58}," evens ",[41,290,63],{"class":62},[41,292,250],{"class":58},[41,294,113],{"class":62},[41,296,297],{"class":116},"filter",[41,299,173],{"class":58},[41,301,261],{"class":260},[41,303,264],{"class":54},[41,305,267],{"class":58},[41,307,308],{"class":62},"%",[41,310,273],{"class":69},[41,312,313],{"class":62}," ===",[41,315,316],{"class":69}," 0",[41,318,179],{"class":58},[41,320,129],{"class":62},[41,322,323],{"class":47}," \u002F\u002F filter\n",[11,325,327],{"id":326},"when-youll-hear-this","When You'll Hear This",[16,329,330],{},"\"Store the results in an array.\" \u002F \"Loop over the array and process each item.\"",[332,333,334],"style",{},"html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":36,"searchDepth":51,"depth":51,"links":336},[337,338,339,340],{"id":13,"depth":51,"text":14},{"id":21,"depth":51,"text":22},{"id":28,"depth":51,"text":29},{"id":326,"depth":51,"text":327},"general","An array is a list of things in order, like a numbered row of boxes. Box 0 holds the first item, box 1 holds the second, and so on.","beginner","md","a",{},"\u002Fterms\u002Fa\u002Farray",[349,350,351,352,353],"Data Structure","Object","Linked List","Loop","Index",{"title":5,"description":342},{"changefreq":356,"priority":357},"weekly",0.7,"terms\u002Fa\u002Farray","Bb5k4vPWd7UiSuOYUuZkSA3ibjHVW-29ruWq7244Ksk",[361,364,369,372,375],{"title":349,"path":362,"acronym":6,"category":341,"difficulty":343,"description":363},"\u002Fterms\u002Fd\u002Fdata-structure","A data structure is a way of organizing information in your code so it is easy to use and fast to access.",{"title":353,"path":365,"acronym":6,"category":366,"difficulty":367,"description":368},"\u002Fterms\u002Fi","database","intermediate","A database index is like the index in the back of a book. Without it, the database reads every single row to find what you want.",{"title":351,"path":370,"acronym":6,"category":341,"difficulty":367,"description":371},"\u002Fterms\u002Fl\u002Flinked-list","A linked list is like a treasure hunt where each clue tells you where the next clue is. Each item (node) holds a value AND a pointer to the next item.",{"title":352,"path":373,"acronym":6,"category":341,"difficulty":343,"description":374},"\u002Fterms\u002Fl\u002Floop","A loop makes your code do something over and over until a condition says stop.",{"title":350,"path":376,"acronym":6,"category":341,"difficulty":343,"description":377},"\u002Fterms\u002Fo\u002Fobject","An object is like a labeled container — instead of numbered boxes like an array, each box has a name.",1776518256045]