About 51 results
Open links in new tab
  1. How do I declare an array in Python? - Stack Overflow

    Aug 23, 2022 · The array structure has stricter rules than a list or np.array, and this can reduce errors and make debugging easier, especially when working with numerical data.

  2. How do I declare and initialize an array in Java? - Stack Overflow

    Jul 29, 2009 · The third way of initializing is useful when you declare an array first and then initialize it, pass an array as a function argument, or return an array. The explicit type is required.

  3. How to create an array containing 1...N

    We'll use that fact later. Array.apply(null, [undefined, undefined, undefined]) is equivalent to Array(undefined, undefined, undefined), which produces a three-element array and assigns …

  4. How do I determine the size of my array in C? - Stack Overflow

    Sep 1, 2008 · An array sent as a parameter to a function is treated as a pointer, so sizeof will return the pointer's size, instead of the array's. Thus, inside functions this method does not work. Instead, …

  5. Loop through an array of strings in Bash? - Stack Overflow

    Jan 16, 2012 · Without them, the for loop will break up the array by substrings separated by any spaces within the strings instead of by whole string elements within the array. ie: if you had declare -a …

  6. How can I remove a specific item from an array in JavaScript?

    How do I remove a specific value from an array? Something like: array.remove(value); Constraints: I have to use core JavaScript. Frameworks are not allowed.

  7. Loop (for each) over an array in JavaScript - Stack Overflow

    Feb 17, 2012 · How can I loop through all the entries in an array using JavaScript?

  8. How do I declare a 2d array in C++ using new? - Stack Overflow

    Jun 2, 2009 · array<array<int, 3>, 2> array2d = array<array<int, >, >(); This line of code creates a "jugged array", which is an one dimensional array that each of its cells is or points to another one …

  9. Get all unique values in a JavaScript array (remove duplicates)

    I have an array of numbers that I need to make sure are unique. I found the code snippet below on the Internet, and it works great until the array has a zero in it. I found this other script here on

  10. Sorting an array of objects by property values - Stack Overflow

    5 While it is a bit of an overkill for just sorting a single array, this prototype function allows to sort Javascript arrays by any key, in ascending or descending order, including nested keys, using dot …