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

@black_hole/array-equals

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@black_hole/array-equals

check if two arrays are equal

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Array-equals

npm npm npm npm npm

install

# Install with npm
$ npm install array-equals --save

# Install with yarn
$ yarn add array-equals

Usage

Two arrays are equal

let arrEquals = require('array-equals')

let arr1 = [1, 2, 3]
let arr2 = [1, 2, 3]
let result = arrEquals(arr1, arr2) // => true

Two arrays are not equal

let arrEquals = require('array-equals')

let arr1 = [1, 2, 3]
let arr2 = [1, 2, 4]
let result = arrEquals(arr1, arr2) // => false

Arrays of different lengths are not equal

let arrEquals = require('array-equals')

let arr1 = [1, 2, 3]
let arr2 = [1, 2, 3, 4]
let result = arrEquals(arr1, arr2) // => false

Multidimensional array are equal

let arrEquals = require('array-equals')

let arr1 = [1, 2, 3, [4, 5, 6]]
let arr2 = [1, 2, 3, [4, 5, 6]]
let result = arrEquals(arr1, arr2) // => true

Arguments(like-Array) are equal

let arrEquals = require('array-equals')

function likeArr () {
    let arr2 = [1, 2, 3]
    return arrEquals(arguments, arr2, true)
}
likeArr(1, 2, 3) // => true

Contributing

CommitsContributor
3Black-Hole

Author

Black-Hole

Keywords

FAQs

Package last updated on 24 Feb 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

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