VOOZH about

URL: https://www.geeksforgeeks.org/javascript/lodash-_-unzipwith-method/

⇱ Lodash _.unzipWith() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Lodash _.unzipWith() Method

Last Updated : 2 Sep, 2024

Lodash_.unzipWith() method accepts iteratee to specify how regrouped values should be combined. The iteratee is invoked with the elements of each group.

Syntax:

_.unzipWith(array, [iteratee = _.identity]);

Parameters:

  • array: This parameter holds the array of grouped elements to process.
  • [iteratee = _.identity]: This parameter holds the function to combine regrouped values.

Return Value:

  • This method returns the new array of regrouped elements.

Example 1: In this example, we are unzipping the given zipped array and using the subtract method for subtracting the values of that array.

Output:

[8, 165, 355]

Example 2: In this example, we are unzipping the given zipped array and using the add method for adding the values of that array.

Output:

[13, 205, 601]
Comment