Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

array.prototype.insert

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array.prototype.insert

This module adds an 'insert' method to the Array object's prototype, which can be used to insert an element into an array at an index calculated by a sorting criteria.

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
12
-40%
Maintainers
1
Weekly downloads
 
Created
Source

Array.prototype.insert

This module adds an 'insert' method to the Array object's prototype, which can be used to insert an element into an array at an index calculated by a sorting criteria.

The method uses a binary lookup algorithm to insert the element at the correct index to maintain the appropriate ordering.

The aim of this is to implement a method that is more performant for than the native options for inserting and sorting an array. Performance comparisons can be found here: https://jsperf.com/array-prototype-insert/

Installation

  • Install the package using your favourite package manager.

    npm install --save array-insert

  • Import the package at the top of entry file of your app or the you want to use it in.

    require('array-insert');

Usage

Assumptions

FAQs

Package last updated on 05 Mar 2018

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