VOOZH about

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

⇱ Lodash _.without() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Lodash _.without() Method

Last Updated : 15 Jul, 2025

Lodash _.without method creates a new array in a filtered form that is there are values to exclude and give new values as output.

Note:

It is dissimilar to the _.pull() method, this method returns a new array.

Syntax:

_.without(array, [values]);

Parameters:

  • array: This parameter holds the array to inspect.
  • [values]: This parameter holds the values to exclude.

Return Value:

  • This method returns the new array of filtered values.

Example 1: In this example, we are removing the given value from the given array and printing the results in the console.

Output:

[ 1.2 ]

Example 2: In this example, we are removing the given value from the given array and printing the results in the console.

Output:

[ 5, 5 ]
[ 8 ]

Example 3: In this example, we are removing the given value from the given array and printing the results in the console.

Output:

[ 'c' ]
[ 'Python', '.Net' ]

Note: This code will not work in normal JavaScript because it requires the library lodash to be installed.

Comment