Socket
Socket
Sign inDemoInstall

calculate-from-index-x

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

calculate-from-index-x

Calculates a fromIndex of a given value for an array.


Version published
Weekly downloads
971
decreased by-12.99%
Maintainers
1
Weekly downloads
 
Created
Source

Travis status Dependency status devDependency status npm version

calculate-from-index-x

Calculates a fromIndex of a given value for an array.

Version: 2.0.0
Author: Xotic750 Xotic750@gmail.com
License: MIT
Copyright: Xotic750

module.exportsnumber

This method calculates a fromIndex of a given value for an array.

Kind: Exported member
Returns: number - The calculated fromIndex. Default is 0.
Throws:

  • TypeError If array is null or undefined.
ParamTypeDescription
arrayarrayThe array on which to calculate the starting index.
fromIndexnumberThe position in this array at which to begin. A negative value gives the index of array.length + fromIndex by asc.

Example

var calcFromIndex = require('calculate-from-index-x');

calcFromIndex([1, 2, 3], 1); // 1
calcFromIndex([1, 2, 3], Infinity); // Infinity
calcFromIndex([1, 2, 3], -Infinity); // 0
calcFromIndex([1, 2, 3], -1); // 2

Keywords

FAQs

Package last updated on 30 Aug 2017

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