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

argminmax

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

argminmax

argmin and argmax functions for Node.js / underscore.js

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

argminmax.js

Often you have an array and you want to find, not the maximum or minimum element but its index (so that you can remove it later, use it in another array, etc.).

This tiny module supplies two functions that do just this.

The functions are added to the "underscore.js" package.

== EXAMPLE ==

var _ = require("underscore"); _.mixin(require("argminmax"));

var array = ["b","aa","ddd","cccc"];

console.log(.argmin(array)) // 1 console.log(.argmin(array, function(x){return x.length})) // 0

Keywords

FAQs

Package last updated on 28 May 2014

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