Created
June 18, 2016 23:33
-
-
Save twhite96/ab6748d39d33afff9040615102bfee8a to your computer and use it in GitHub Desktop.
Mutations Free Code Camp Algorithm
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 mutation(arr) { | |
var arr1 = arr[1].toLowerCase(); | |
var arr2 = arr[0].toLowerCase(); | |
for (var i = 0; i < arr1.length; i++) { | |
if (arr2.indexOf(arr1[i]) < 0) | |
return false; | |
} | |
return true; | |
} | |
mutation(["hello", "hey"]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment