Skip to content

Instantly share code, notes, and snippets.

@jasp402
Last active August 5, 2020 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasp402/843cef2cd949d68b1223b5048b7e20ed to your computer and use it in GitHub Desktop.
Save jasp402/843cef2cd949d68b1223b5048b7e20ed to your computer and use it in GitHub Desktop.
JS-PackTools | allEqual
const jsPackTools = require('js-packtools')();
//👇🏻 Check if all the elements of an array are equal
jsPackTools.allEqual([1, 1, 1, 1, 1, 1, 1, 1]); //⇒ true
//👇🏻 If at least one is different then it returns false
jsPackTools.allEqual([1, 1, 1, 1, 2, 1, 1, 1]); //⇒ false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment