{"ScriptPreparationCode":"function isAnagram (word1, word2) {\r\n if(typeof word1 !== \u0027string\u0027 || typeof word2 !== \u0027string\u0027) {\r\n return;\r\n }\r\n\r\n if(word1.length !== word2.length) {\r\n return false;\r\n }\r\n\r\n if(sanitizeString(word1) === sanitizeString(word2)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\nfunction sanitizeString(text) {\r\n return text.toLowerCase().replace(/\\s/g, \u0027\u0027).split(\u0022\u0022).sort().join();\r\n}","TestCases":[{"Name":"Check length","Code":"isAnagram(\u0022one\u0022, \u0022onee\u0022)","IsDeferred":false},{"Name":"Check with different cases","Code":"isAnagram(\u0022soLiN\u0022, \u0022lions\u0022)","IsDeferred":false},{"Name":"Check single letter","Code":"isAnagram(\u0022a\u0022, \u0022a\u0022)","IsDeferred":false}]}