© 2023 Hashnode
#array
In JavaScript, an array is a data structure that allows us to store a collection of elements in a specific order. Each element in an array is identified by its index, which is a non-negative integer. …
I'll keep this short. Ever seen a code snippet where an integer variable was initialized and used to access an array like this: const funArray = ['This', 'should', 'be', 'fun'] let i = 0; let j = 0; …
Arrays are essential data structures used in JavaScript. It lets you store sequences of values. With array methods, you can transform and manipulate values in your arrays. Sometimes the data you get b…
Introduction. Let's say you are a librarian at a library. Every day, you receive dozens of books from authors to be added to the library collections. Now, it is your job to ensure that the books are o…
An array is a collection of similar data stored in a memory location. What is a collection? A collection is a large number of items. It can be two or two thousand. In programming, we work with data everywhere. Data could be anything a name,…
Simple Approach will update soon with the newly learnt approach. :) let arr = [1,2,3,3,4,5,4,6,7,7,7,8,9,10,10,10,10] let n = arr.length function thirdLargest (arr,n){ let first, second , third ; sec…
Recently I found myself having to find a missing number in an array. After some searching on the internet, I found a simple and efficient answer. I wanted to know why it worked and dug further into th…
Week 2 Arrays CS50's Week 2 focuses on arrays, a fundamental concept in programming that allows us to store and manipulate collections of data. In this week I learnt what arrays are, how to declare an…
What is the Sliding Window Technique? The sliding window technique is a powerful algorithmic pattern that involves using a window to track a subset of elements in an array or sequence. The window star…
JavaScript arrays are a powerful feature of the language that allows developers to store collections of data in a single variable. Arrays can be manipulated in many ways to add, remove, or modify elem…