JavaScript Array Examples Last Updated : 05 Aug, 2025 Comments Improve Suggest changes Like Article Like Report JavaScript array is used to store multiple elements in a single variable. JavaScript let a = ["HTML", "CSS", "JS"] console.log(a) Output[ 'HTML', 'CSS', 'JS' ] Using New Keyword JavaScript // Declaring an array using Array Constructor let a = new Array(3) a[0] = "HTML" a[1] = "CSS" a[2] = "JS" console.log(a) Output[ 'HTML', 'CSS', 'JS' ] All the JavaScript array-related articles into three sections based on their difficulty levels: Easy, Medium, and Hard. This organization aims to help learners gradually progress from basic to more complex concepts.Easy:The Easy level includes articles that cover fundamental operations and straightforward tasks with JavaScript arrays.Insert an ElementRemove ElementRemove DuplicatesGet a Value from a JSON ArrayReplace an ItemFind DuplicatesSelect a Random ElementInsert at Specific IndexGet Array LengthAn Array of Given SizeAppend in an ArrayFirst and Last in an ArrayReverse an ArrayEmpty an Array in JavaScriptConvert an Array into a StringSearch an ElementLargest in an ArrayFirst N from an ArrayMedium:The Medium level includes articles that delve deeper into working with JavaScript arrays, exploring more advanced operations and methods:Modify an Object's Property in Array Objects Sort Object Array by Date Copy Items into Another ArrayCount Occurrences of All Items Convert Array to Object Compare Two ArraysAdd Object to Array Create Comma Separated List Find the Min/Max ElementClone an ArrayCreate HTML ListConvert String to Array Convert Set to ArrayCreate 2D Array Sum Array ElementsCreate 1 to N Array Delete Item from ArrayFind an Item in ArrayAdd Elements to StartLoop Through ObjectRemove Object by PropertyMove an Array ElementStore Array in LocalStorageRemove Empty ElementsConvert Byte Array to StringSort Numeric ArrayFind Object Index Change the Array Value Find the Most Frequent ElementMost Frequently ElementMap in Reverse OrderCalculate Standard DeviationFind the Missing NumberRemove Falsy ValuesRemove Min/Max ElementsFind First Non-Repeated ElementFind the Majority ElementGet All Non-Unique ValuesFind Minimum Repeating IndexHard:The Hard level includes articles that cover more intricate and less common tasks Remove Duplicates from Array ObjectsGet Distinct Object ValuesConvert Object into Array ObjectsConvert Array of Objects to a MapSplit an Array into ChunksCheck Array for SubstringRemove Multiple ItemsFind Second LargestConvert Map Keys to ArrayGroup Objects by PropertySort Words Alphabetical Quick SortCheck Value at IndexList Array KeysFind Find Target IndexMerge Arrays In-PlaceRemove Null ObjectsSort Array by ValuesFind Next Smaller ElementSort 1 to N Array Find Largest Subarray Divisible by KFind K Most FrequentCount Unequal Pairs Sparse TableRotation CountArray from Pair Sum Find Union and IntersectionCount Numbers Less or EqualFind Median in a StreamOR and AND of Elements Max Profit with ShareK-th Largest SumMax Distance Between Element Calculate MeanSearch Rotated ArrayRange Sum QueryRearrange in Max-Min FormTranspose 2D ArrayLongest Consecutive SequenceSort Array Objects by Property Merge SortSquare Root (Sqrt) DecompositionRearrange Even/Odd Positions Shortest Distance Between WordsFilter Array Objects in ES6Compare Array ObjectsFind Object Property ValuesCreate Range ArrayFind Nth Smallest/Largest Element Store Dates in RangeSort Mixed Data Type ArrayCount Data TypesFind Unique Elements from Two ArraysMinimum Swaps to Sort Reorder an ArrayUnique Values from ArraysSwap VariablesSwap First and Last ElementsSplit Map Keys and ValuesFind the K-th Largest Sum Find Max Distance Between ElementUnique Elements CheckCreate Intersection of Two ArraysCreate Pre-Filled ArrayRemove Objects from Associative ArrayUngroup Elements from Zipped ArrayCreate Unique Array with SetLoop Through Array Find Top Three ElementsMerge Two Sorted Find Nth Smallest/Largest ElementConvert CSV to 2D ArrayShort Circuit forEachFind the Largest Subarray with Sum KLeft Rotate by One Search Rotated ArrayConstruct an Array from Its Pair Sum ArraySpace Optimization Using Bit ManipulationsConstruct Array from SumFind Max Profit wih ShareFind K Most Occurrences Recommended Links:Interesting Facts about JavaScript Arrays JavaScript Array Complete Reference JavaScript TutorialRecent articles on JavaScript Arrays in JavaScript Visit Course Arrays in JavaScript Working of Arrays in JavaScript Comment More info V vishalkumar2204 Follow Improve Article Tags : JavaScript Web Technologies javascript-array Explore JavaScript BasicsIntroduction to JavaScript4 min readVariables and Datatypes in JavaScript6 min readJavaScript Operators5 min readControl Statements in JavaScript4 min readArray & StringJavaScript Arrays7 min readJavaScript Array Methods7 min readJavaScript Strings5 min readJavaScript String Methods9 min readFunction & ObjectFunctions in JavaScript5 min readJavaScript Function Expression3 min readFunction Overloading in JavaScript4 min readObjects in JavaScript4 min readJavaScript Object Constructors4 min readOOPObject Oriented Programming in JavaScript3 min readClasses and Objects in JavaScript4 min readWhat Are Access Modifiers In JavaScript ?5 min readJavaScript Constructor Method7 min readAsynchronous JavaScriptAsynchronous JavaScript2 min readJavaScript Callbacks4 min readJavaScript Promise4 min readEvent Loop in JavaScript4 min readAsync and Await in JavaScript2 min readException HandlingJavascript Error and Exceptional Handling6 min readJavaScript Errors Throw and Try to Catch2 min readHow to create custom errors in JavaScript ?2 min readJavaScript TypeError - Invalid Array.prototype.sort argument1 min readDOMHTML DOM (Document Object Model)9 min readHow to select DOM Elements in JavaScript ?3 min readJavaScript Custom Events4 min readJavaScript addEventListener() with Examples9 min readAdvanced TopicsClosure in JavaScript4 min readJavaScript Hoisting6 min readScope of Variables in JavaScript3 min readJavaScript Higher Order Functions7 min readDebugging in JavaScript4 min read Like