Top "Arrays" questions

An array is an ordered linear data structure consisting of a collection of elements (values, variables, or references), each identified by one or more indexes.

How can I remove a specific item from an array?

I have an array of numbers and I'm using the .push() method to add elements to it. Is there a …

javascript arrays
How do I declare and initialize an array in Java?

How do I declare and initialize an array in Java?

java arrays
For-each over an array in JavaScript

How can I loop through all the entries in an array using JavaScript? I thought it was something like this: …

javascript arrays loops foreach iteration
Loop through an array in JavaScript

In Java you can use a for loop to traverse objects in an array as follows: String[] myStringArray = {"Hello", "World"}; …

javascript arrays loops for-loop
How to append something to an array?

How do I append an object (such as a string or number) to an array in JavaScript?

javascript arrays append
How do I empty an array in JavaScript?

Is there a way to empty an array and if so possibly with .remove()? For instance, A = [1,2,3,4]; How can I …

javascript arrays
Deleting an element from an array in PHP

Is there an easy way to delete an element from an array using PHP, such that foreach ($array) no longer …

php arrays unset
How do I check if an array includes a value in JavaScript?

What is the most concise and efficient way to find out if a JavaScript array contains a value? This is …

javascript arrays algorithm time-complexity javascript-objects
What's the simplest way to print a Java array?

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + …

java arrays printing
Checking if a key exists in a JavaScript object?

How do I check if a particular key exists in a JavaScript object or array? If a key doesn't exist, …

javascript arrays object