/*
  Free Code Camp Challenge  - Mutations
  https://www.freecodecamp.com/challenges/mutations
*/

function mutation(arr) {
  var firstElement = arr[0].toLowerCase();
  var secondElement = arr[1].toLowerCase();
  var contains = 0;

  for (var i = 0; i < secondElement.length; i++) {
    contains = firstElement.indexOf(secondElement[i]);

    if (contains !== - 1) {
      return true;
    }
  }

  return false;
}

console.log(mutation(["hello", "hey"]));

/*
  Free Code Camp Challenge  - Mutations
  https://www.freecodecamp.com/challenges/mutations
*/

function mutation(arr) {
  var firstElement = arr[0].toLowerCase();
  var secondElement = arr[1].toLowerCase();
  var contains = 0;

  for (var i = 0; i < secondElement.length; i++) {
    contains = firstElement.indexOf(secondElement[i]);

    if (contains !== - 1) {
      return true;
    }
  }

  return false;
}

mutation(["hello", "hey"]);

Remove console.log the invocation function
Remove console.log the invocation function
