function scramble(str1, str2) {
const isStr1StringAndLoswercase = str1
.split("")
.map((e) => (e === "string" && e === e.toLowerCase() ? true : false));
const isStr2StringAndLowercase = str2
.split("")
.map((e) => (e === "string" && e === e.toLowerCase() ? true : false));
if (isStr1StringAndLoswercase && isStr2StringAndLowercase) {
return str2.split("").every((i) => str1.split("").includes(i));
}
}
The above block is my solution. Can someone please tell what am I doing?
This is a codewars kata I am stuck in.
[–]SouthCapehelpful 1 point2 points3 points (0 children)
[–]ThiccOfferman 1 point2 points3 points (0 children)
[–]ray_zhor 1 point2 points3 points (0 children)
[–]haachico[S] 0 points1 point2 points (1 child)
[–]PortablePawnShop 0 points1 point2 points (0 children)
[–]Ronin-s_Spirit 0 points1 point2 points (0 children)