Skip to content

Instantly share code, notes, and snippets.

@dmidlo
Created November 23, 2015 05:41
Show Gist options
  • Save dmidlo/1516fa648d479ebc15db to your computer and use it in GitHub Desktop.
Save dmidlo/1516fa648d479ebc15db to your computer and use it in GitHub Desktop.
function CheckStrMutation(str1,str2) {
var arr = [str1,str2];
var mutationBool = true;
for(var i = 0; i < arr[1].length; i++)
{
if(arr[0].toLowerCase().indexOf(arr[1].slice(i,i+1).toLowerCase()) === -1)
{
mutationBool = false;
}
}
return(mutationBool);
}
CheckStrMutation("hello", "hey");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment