challenge-algorithms-v2.0-g.../08-isAnagram/index.js

6 lines
221 B
JavaScript

export function isAnagram(word1, word2) {
// implementar logica aqui
var y = word1.toLowerCase().split("").sort().join(""),
z = word2.toLowerCase().split("").sort().join("");
return (z === y) ? true : false;
}