VOOZH about

URL: https://www.geeksforgeeks.org/javascript/underscore-js-_-omit-function/

⇱ Underscore.js _.omit() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Underscore.js _.omit() Function

Last Updated : 12 Jul, 2025

Underscore.js_.omit() function is used to return a copy of the object that was filtered to omit the blacklisted keys.

Syntax:

_.omit(object, *keys);

Parameters:

  • object: This parameter holds the value of an object.
  • keys: It is an optional parameter. It contains the key name that the value needs to be omitted.

Return Value:

It returns a copy of the object that was filtered to omit the blacklisted keys.

Example 1: In this example, we are using the Underscore.js _.omit() function.

Output:

👁 Image

Example 2: In this example, we are using the Underscore.js _.omit() function.

Output:

👁 Image
Comment