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 to create an array containing 1...N

I'm looking for any alternatives to the below for creating a JavaScript array containing 1 through to N where N is …

javascript arrays
How to add elements to an empty array in PHP?

If I define an array in PHP such as (I don't define its size): $cart = array(); Do I simply add …

php arrays variables
Convert pandas dataframe to NumPy array

I am interested in knowing how to convert a pandas dataframe into a NumPy array. dataframe: import numpy as np …

python arrays pandas numpy dataframe
Get JavaScript object from array of objects by value of property

Let's say I have an array of four objects: var jsObjects = [ {a: 1, b: 2}, {a: 3, b: 4}, {a: 5, b: 6}, {a: 7, b: 8} ]; Is …

javascript arrays
Sorting an array of objects by property values

I've got the following objects using AJAX and stored them in an array: var homes = [ { "h_id": "3", "city": "Dallas", "state": "…

javascript arrays sorting
Best way to find if an item is in a JavaScript array?

What is the best way to find if an object is in an array? This is the best way I …

javascript arrays
Check if an array is empty or exists

When the page is loading for the first time, I need to check if there is an image in image_…

javascript jquery arrays
How to convert Java String into byte[]?

Is there any way to convert Java String to a byte[] (not the boxed Byte[])? In trying this: System.out.…

java arrays string
How do I create an array of strings in C?

I am trying to create an array of strings in C. If I use this code: char (*a[2])[14]; a[0]="blah"; …

c arrays string
How to compare arrays in JavaScript?

I'd like to compare two arrays... ideally, efficiently. Nothing fancy, just true if they are identical, and false if not. …

javascript arrays json