Wednesday, October 8, 2025
HomeLanguagesJavascriptLodash _.overSome() Method

Lodash _.overSome() Method

The Lodash _.overSome() method is used to create a function that checks if any of the predicates return truthy when invoked with the received arguments.

Syntax: 

_.overSome( predicates )

Parameters: This method accepts one parameter as mentioned above and described below:

  • predicates: This is the predicate to invoke.

Return Value: This method returns a new function.

Example 1:

Javascript




// Requiring the lodash library  
const _ = require("lodash");              
  
// Use of _.overSome() method 
var func = _.overSome([Boolean, isFinite]);
  
// Saving the result
let gfg1 = func(10);
let gfg2 = func(-5);
let gfg3 = func(null);
let gfg4 = func(NaN);
       
// Printing the output  
console.log(gfg1); 
console.log(gfg2); 
console.log(gfg3); 
console.log(gfg4);


Output:

true
true
true
false

Example 2:

Javascript




// Requiring the lodash library  
const _ = require("lodash");              
  
// Use of _.overSome() method 
var func = _.overSome([(Math.min,  Math.max)]);
  
// Saving the result
let gfg = func(2, 4, -6, 8);
  
// Printing the output  
console.log(gfg);


Output :

true
Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32342 POSTS0 COMMENTS
Milvus
87 POSTS0 COMMENTS
Nango Kala
6712 POSTS0 COMMENTS
Nicole Veronica
11875 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11937 POSTS0 COMMENTS
Shaida Kate Naidoo
6833 POSTS0 COMMENTS
Ted Musemwa
7092 POSTS0 COMMENTS
Thapelo Manthata
6786 POSTS0 COMMENTS
Umr Jansen
6789 POSTS0 COMMENTS