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.

Copy array by value

When copying an array in JavaScript to another array: var arr1 = ['a','b','c']; var arr2 = arr1; arr2.push('d'); //…

javascript arrays
How to echo or print an array in PHP?

I have this array Array ( [data] => Array ( [0] => Array ( [page_id] => 204725966262837 [type] => WEBSITE ) [1] => Array ( [page_id] =&…

php arrays
Split string into an array in Bash

In a Bash script I would like to split a line into pieces and store them in an array. The …

arrays bash split
How to find if an array contains a specific string in JavaScript/jQuery?

Can someone tell me how to detect if "specialword" appears in an array? Example: categories: [ "specialword" "word1" "word2" ]

javascript jquery arrays string
Array Length in Java

I declared an array as shown below: int[] arr = new int[10]; Then I assigned following values to the array: arr[0] = 1; …

java arrays
How to check if a value exists in an array in Ruby

I have a value 'Dog' and an array ['Cat', 'Dog', 'Bird']. How do I check if it exists in the …

ruby arrays
Convert Array to Object

What is the best way to convert: ['a','b','c'] to: { 0: 'a', 1: 'b', 2: 'c' }

javascript arrays node.js object
Reading CSV file and storing values into an array

I am trying to read a *.csv-file. The *.csv-file consist of two columns separated by semicolon (";"). I am able to …

c# .net arrays csv
How do you convert a byte array to a hexadecimal string, and vice versa?

How can you convert a byte array to a hexadecimal string, and vice versa?

c# arrays hex
PHP array delete by value (not key)

I have a PHP array as follows: $messages = [312, 401, 1599, 3, ...]; I want to delete the element containing the value $del_val (for …

php arrays