Last active
September 11, 2019 11:10
-
-
Save omosehin/6b6c664ba85088a1bc00b5b8a6bf0db3 to your computer and use it in GitHub Desktop.
Function to test for identical array
This file contains 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 identical_Test = arr => { | |
for(let i = 0; i < arr.length - 1; i++) { | |
if(arr[i] !== arr[i+1]) { | |
return false; | |
} | |
} | |
return true; | |
} | |
var arrElement = ["avk", "avk", "avk", "avk"]; | |
console.log(identical_Test(arrElement)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment