Last active
August 5, 2020 21:53
-
-
Save jasp402/843cef2cd949d68b1223b5048b7e20ed to your computer and use it in GitHub Desktop.
JS-PackTools | allEqual
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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