About 29,000,000 results
Open links in new tab
  1. javascript - What is the concept of Array.map? - Stack Overflow

    Jun 28, 2013 · Summary Array.map is a function which is located on Array.prototype.map. The function does the following: Creates a new array with the same amount of entries/elements. …

  2. php - Performance of foreach, array_map with lambda and …

    Aug 9, 2013 · array_map (and its related functions array_reduce, array_filter) let you write beautiful code. If array_map was much slower it would be a reason to use foreach, but its very …

  3. transform an array of objects with map ( ) - Stack Overflow

    Aug 30, 2021 · Array.map() takes in a function as a parameter, passes each item of the array into the function, and returns an array of the result. For example, if I wanted to multiply each of the …

  4. How can I use array_map with keys and values, but return an array …

    Based on @Jannie Theunissen answer the correct way of getting an array_map working with key for comparing and assigning values based on second array for example is:

  5. javascript - Why does the `map` method apparently not work on …

    y = [undefined, undefined, undefined]; creates an array with 3 items (slots), each with the value undefined. In this case the slots ( [0], [1] and [2]) are created and the items they refer to are …

  6. Array_map function in php with parameter - Stack Overflow

    PHP's array_map() supports a third parameter which is an array representing the parameters to pass to the callback function. For example trimming the / char from all array elements can be …

  7. php - array_map with access to keys - Stack Overflow

    It seems to always construct a new array, i.e. discarding my string keys (key1 and key2), while a single-array array_map() keeps them. I can use array_walk() but it has a rather strange API …

  8. PHP: Can I get the index in an array_map function?

    When using this approach, it's important to use an anonymous function as the callback and to never reuse that anonymous function to avoid referencing the same static variable outside of …

  9. How to use an array of arrays with array_map(...) in PHP?

    Sep 20, 2016 · This is working code that has been tested and it answers the question of having a variable number of unknown arrays to pass to the array_map function. If you down vote at …

  10. How to convert Map to array of object? - Stack Overflow

    Jun 27, 2019 · i'm trying to convert a Map into array of object Lets say I have the following map: let myMap = new Map().set('a', 1).set('b', 2); And I want to convert the above map into the …