About 69,300 results
Open links in new tab
  1. Using IF condition in Javascript's map method

    Jul 24, 2022 · Array.prototype.find () - JavaScript | MDN The find () method of Array instances returns the first element in the provided array that satisfies the provided testing function. If no values satisfy …

  2. How to use JavaScript Array.prototype.map () - JavaScript Map …

    Jun 1, 2021 · The method map of the Array prototype allows you to grab a hold of each element inside an array and apply a function to them. After map finishes iterating through the array, it will return a …

  3. Using .Map() on nested arrays - JavaScript - The freeCodeCamp Forum

    May 30, 2022 · Each element in that array is an array of two numbers. You don’t need to map each sub-array, just return an array where the first element is the same and the second one is the same + 1. If …

  4. React - Use Array.map () to Dynamically Render Elements - .map is ...

    Jan 25, 2023 · Yes, even in this case the map method technically maps an array to another array, as it would ordinarily. However, my understanding is that, when you map array items into JSX elements, …

  5. How to Map () a subarray or nested array - JavaScript - The ...

    Jul 23, 2017 · This returns a new array array of [ 6, 21, 39, 141, 165, 231 ] But when I use an array with subarrays, the map () method seems doesn’t loop through the whole array and their sub indexes.

  6. Mapping an array within a mapped array? - The freeCodeCamp Forum

    Sep 24, 2018 · I have an array of objects in my state called ‘ideas’. Each object in the array has a property called ‘premises’, and that property is an array. I’m trying to map through ideas, and within …

  7. .map is suddenly not a function? - The freeCodeCamp Forum

    Jul 5, 2017 · Because .map() is an array method, you’ll need to turn the data you want to work with into an array. Using the example above, since items is a comma separated string, the .split() method is …

  8. Using destructuring in .map - JavaScript - The freeCodeCamp Forum

    May 23, 2021 · Use the map Method to Extract Data from an Array Hints Hint 1 array.prototype.map takes a function as in input and returns an array. The returned array includes elements that is …

  9. If statement in array map - The freeCodeCamp Forum

    Jun 12, 2020 · Here’s the same thing in one line using ternary operator (one-line if-else). arr.map(char => pairs.hasOwnProperty(char) ? pairs[char] : char) Also, char = char assigns char to itself, I’m not …

  10. JS: How to use map function to replace a for-loop that loop x times?

    May 21, 2020 · Not really, because the point it to map over an existing array. So you could write a function that created an array from 0 to a given number, then map that, but it’s not very efficient. And …