Lodash _.noConflict() method of Util is used to revert the variable to its former value and return a reference to the lodash function.
Syntax:
_.noConflict();
Parameters:
This method doesn’t accept any parameter.
Return Value:
This method returns the lodash function.
Example: In this example, we are getting the reference of lodash function and printing it into the console.
Javascript
const _ = require( 'lodash' );
let lod = _.noConflict();
console.log(lod);
|
Output:
[Function: lodash] {
templateSettings: {
escape: /<%-([\s\S]+?)%>/g,
evaluate: /<%([\s\S]+?)%>/g,
interpolate: /<%=([\s\S]+?)%>/g,
variable: '',
imports: { _: [Circular] }
},
..........
upperCase: [Function (anonymous)],
upperFirst: [Function (anonymous)],
each: [Function: forEach],
eachRight: [Function: forEachRight],
first: [Function: head],
VERSION: '4.17.21',
_: [Circular *1]
}
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks 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!
Last Updated :
03 Nov, 2023
Like Article
Save Article