Rotate String Leetcode Question Solve - Javascript DSA Question

Now I will explain the solve of Rotate sting leetcode easy problem solve in javascript. The question is Given two strings s and goal, return trueif and only ifscan becomegoalafter some number ofshiftsons.
A shift on s consists of moving the leftmost character of s to the rightmost position.
- For example, if
s = "abcde", then it will be"bcdea"after one shift.
Example 1:
Input: s = "abcde", goal = "cdeab"
Output: true
Example 2:
Input: s = "abcde", goal = "abced"
Output: false
Explaination
First we will check the string length and the goal string length is same or not. It should be same.
Next, addition the both string and the goal. If the rotation is possible the goal will present as substring in the addition.
var rotateString = function(s, goal) {
if(s.length!==goal.length){
return false
}
let fullStr = s+s;
return fullStr.includes(goal);
};



