function rotations(str1, str2) {
if (str1.length != str2.length)
return false;
console.log(str1 + str1);
return (str1 + str1).indexOf(str2) != -1;
}
const str1 = "abcxd";
const str2 = "cxdab";
if (rotations(str1, str2))
console.log("yes");
else
console.log("no");
/*
run:
"abcxdabcxd"
"yes"
*/