VOOZH about

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

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


  • Courses
  • Tutorials
  • Interview Prep

Underscore.js _.noop() Function

Last Updated : 10 Jul, 2020

Underscore.js is a JavaScript library that makes operations on arrays, string, objects much easier and handy. The _.noop() function is used to return "undefined" irrespective of the arguments passed to it.

Note: It is very necessary to link the underscore CDN before going and using underscore functions in the browser. When linking the underscore.js CDN The "_" is attached to the browser as global variable.

Syntax:

_.noop();

Parameters: It takes optional parameter of any type.

Return Value: This function returns the value of type undefined.

Example 1:

Output:

👁 Image

Example 2:

Output:

👁 Image

Example 3: Passing parameters to the _.noop() function.

Output:

👁 Image
Comment