var stringRotation = function (a, b) {
  return (a + a).indexOf(b) > -1;
};

var stringRotation = function (a, b) {
  if (a.length != b.length)
    return false;
  return (a + a).indexOf(b) > -1;
};

Check if the two strings are the same length
Check if the two strings are the same length
