Guest User

Untitled

a guest
Feb 19th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. function mutation(arr) {
  2. var count = 0;
  3. var str = arr[0].toLowerCase();
  4. var match = arr[1].toLowerCase().split("");
  5.  
  6. for (var i = 0; i <= match.length; i++) {
  7. if (str.indexOf(match[i]) !== -1) {
  8. count++;
  9. }
  10. }
  11. return (count == match.length) ? true : false;
  12. }
  13.  
  14. mutation(["hello", "hey"]);
Add Comment
Please, Sign In to add comment