Skip to content

Instantly share code, notes, and snippets.

@mtroiani
Created December 12, 2015 05:34
Show Gist options
  • Save mtroiani/517039cba939965d6939 to your computer and use it in GitHub Desktop.
Save mtroiani/517039cba939965d6939 to your computer and use it in GitHub Desktop.
http://www.freecodecamp.com/mtroiani 's solution for Bonfire: Mutations
// Bonfire: Mutations
// Author: @mtroiani
// Challenge: http://www.freecodecamp.com/challenges/bonfire-mutations
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function mutation(arr) {
var target = arr[0];
target = target.toLowerCase().split('');
var test = arr[1];
test = test.toLowerCase().split('');
for (var i = 0; i < test.length; i ++) {
if (target.indexOf(test[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