About 10,400,000 results
Open links in new tab
  1. How to create an array containing 1...N

    Why go through the trouble of Array.apply(null, {length: N}) instead of just Array(N)? After all, both expressions would result an an N -element array of undefined elements. The difference is that …

  2. How to add a string to a string [] array? There's no .Add function

    Array.Resize is the proper way to resize an array. If you add a comment before the code snippet saying it's rarely the best way to handle situations where the array represents a resizable …

  3. How can I initialize all members of an array to the same value?

    How would you use memset to initialize a int array to some value larger than 255? memset only works if the array is byte sized.

  4. Remove duplicate values from a JavaScript array - Stack Overflow

    If you want to remove objects from an array that have exactly the same properties and values as other objects in the array, you would need to write a custom equality checking function to …

  5. Initialising an array of fixed size in Python - Stack Overflow

    For most C use cass of an array, a normal (non-fixed) list is the idiomatic python equivalent. This is an answer to the question, as it probably helps the the OP (who is transitting from C to …

  6. Difference between array [i] [:] and array [i,:] - Stack Overflow

    May 17, 2017 · 4 x[:] makes a shallow copy of a list, but is virtually useless when x is an array. It makes a new view - same data and shape, but different array object. If that's confusing you …

  7. How can I access the index value in a 'for' loop? - Stack Overflow

    Here are twelve examples of how you can access the indices with their corresponding array's elements using for loops, while loops and some looping functions. Note that array indices …

  8. All possible array initialization syntaxes - Stack Overflow

    What are all the array initialization syntaxes that are possible with C#?

  9. What's the simplest way to print a Java array? - Stack Overflow

    FYI, Arrays.deepToString() accepts only an Object [] (or an array of classes that extend Object, such as Integer, so it won't work on a primitive array of type int []. But Arrays.toString(<int …

  10. javascript - Copy array items into another array - Stack Overflow

    I have a JavaScript array dataArray which I want to push into a new array newArray. Except I don't want newArray[0] to be dataArray. I want to push in all the items into the new array: var …