Created
March 7, 2020 21:06
-
-
Save joeyred/23a6d503143b414277e923beba183042 to your computer and use it in GitHub Desktop.
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
function arraysMatch(arrayOne, arrayTwo) { | |
let match = false; | |
if (arrayOne.length !== arrayTwo.length) { | |
return false; | |
} | |
for (let indexOne = 0; indexOne < arrayOne.length; indexOne += 1) { | |
// For checking for a match to the current ArrayOne value | |
let valueMatch = false; | |
for (let indexTwo = 0; indexTwo < arrayTwo.length; indexTwo += 1) { | |
if (arrayOne[indexOne] === arrayTwo[indexTwo]) { | |
valueMatch = true; | |
break; | |
} | |
} | |
match = valueMatch; | |
} | |
return match; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment