Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mutation(arr) {
- var count = 0;
- var str = arr[0].toLowerCase();
- var match = arr[1].toLowerCase().split("");
- for (var i = 0; i <= match.length; i++) {
- if (str.indexOf(match[i]) !== -1) {
- count++;
- }
- }
- return (count == match.length) ? true : false;
- }
- mutation(["hello", "hey"]);
Add Comment
Please, Sign In to add comment