Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var str1 = "clockwise";
- var str2 = "owe clicks";
- function check (str1, str2) {
- str1 = str1.replace(/ /g, "");
- str2 = str2.replace(/ /g, "");
- for (var i = 0; i < str1.length; i++) {
- if (str2.indexOf(str1[i]) >= 0 ) {
- str2 = str2.replace(str1[i], "");
- } else {
- document.write("false");
- break;
- }
- }
- if (str2.length > 0) {
- document.write("false");
- } else {
- document.write("true");
- }
- }
- check(str1, str2);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement