w10schools
Login Register
  • Home
  • Tutorials
    • HTML, CSS
      • HTML, HTML5
      • CSS, CSS3
    • XML
    • JavaScript, AJAX
    • PHP
    • Ruby on Rails
      • Ruby
      • Rails
    • ASP.NET
      • ASP
      • C# .NET
    • Java
      • JSP
    • Databases
      • MySQL
      • MSSQL Server
      • Oracle
    • Web Server
      • Windows
      • Linux
      • Apache
      • IIS
    • Design
      • Dreamweaver
      • Flash
      • Photoshop
      • Fireworks
      • CorelDRAW
      • Illustrator
  • References
    • HTML
      • Bootstrap
    • CSS
      • CSS Selectors
      • Sass
    • JavaScript
    • Mobile Apps
      • Cordova
    • Ruby on Rails
      • Ruby
      • Rails
    • PHP
      • Function
      • Language
      • CodeIgniter
      • Phalcon
      • PHPUnit
      • Symfony
      • Drupal
      • Yii
      • Laravel
    • Perl
      • Perl
    • Python
      • Python
      • Django
      • NumPy
      • Pandas
      • scikit-image
      • scikit-learn
      • Statsmodels
      • Matplotlib
    • Lua
      • Lua
    • C, C++
      • C
      • C++
    • Server
      • Docker
      • Apache HTTP Server
      • Nginx
    • Database
      • PostgreSQL
    • Big Data
      • TensorFlow
    • Game Development
      • Phaser
      • LÖVE
  • Articles
    • News
    • General
      • Website Promotion
      • Online Advertising
      • Make Money Online
    • Editorials
    • Interviews
    • Web Roundups
  • Resources
    • Design
      • Fonts
      • Graphics
      • Vectors
      • Templates
      • UI (User Interface)
      • Brushes
      • Patterns, Backgrounds
      • Textures
    • Web Development
      • HTML, CSS
      • XML
      • JavaScript, AJAX
      • Ruby on Rails
      • PHP
      • Java
      • .NET
      • Python
      • Perl
      • Flash
    • Mobile Application Development
      • Mobile Development Tools
      • Swift
    • Online Services
      • Online Storage
      • Web Hosting
  • Tools
    • Generators
Edit
In Place Editing Advanced Editing
  • References
  • JavaScript
  • Lodash
  • Function

_.unary

_.unary(func)

source npm package

Creates a function that accepts up to one argument, ignoring any additional arguments.

Since

4.0.0

Arguments

  1. func (Function): The function to cap arguments for.

Returns

(Function): Returns the new capped function.

Example

_.map(['6', '8', '10'], _.unary(parseInt));
// => [6, 8, 10]
Links:
  • https://lodash.com/docs/4.17.2#unary
doc_Lodash
doc_Lodash
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.

Popular Articles
Named Unary Operators Named Unary Operators The various named unary operators are treated as functions with one argument, with optional parentheses. If any list operator
std::unary_function Defined in header <functional> template <typename ArgumentType, typename ResultType> struct unary_function; (until C++17)(dep
Symbolic Unary Operators Symbolic Unary Operators Unary "!" performs logical negation, that is, "not". See also not for a lower precedence version of this. Unary "-" perfor
std::unary_negate Defined in header <functional> template< class Predicate > struct unary_negate : public std::unary_function<Predicate::argumen
gis.geos.GEOSGeometry.unary_union GEOSGeometry.unary_union New in Django 1.10. Computes the union of all the elements of this geometry. The result obeys the following contract: U


Return to View
  • Facebook
  • Tweet
  • Digg it
  • Stumbleupon
  • Delicious
  • Plus Share

Designed by : w10schools

service@w10schools.com

Our Partners: aeeble – Providing content publishing and search solutions