Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

underscore

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

underscore

JavaScript's functional programming helper library.

  • 1.4.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12M
decreased by-2.3%
Maintainers
1
Weekly downloads
 
Created

What is underscore?

The underscore npm package is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects. It includes a wide range of functions for collections, arrays, functions, objects, and more.

What are underscore's main functionalities?

Collections

Iterates over a list of elements, yielding each in turn to an iteratee function.

_.each([1, 2, 3], function(num) { console.log(num); });

Arrays

Produces a duplicate-free version of the array.

_.uniq([1, 2, 1, 4, 1, 3]);

Functions

Curries a function so that it can be called with fewer arguments than it expects.

var greet = function(name) { return 'hi: ' + name; }; var greetCurried = _.curry(greet); greetCurried('Bob');

Objects

Copy all of the properties in the source objects over to the destination object.

_.extend({name: 'moe'}, {age: 50});

Utilities

Returns a random integer between the given min and max, inclusive.

_.random(0, 100);

Other packages similar to underscore

Keywords

FAQs

Package last updated on 30 Jan 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc