# Palindrome Check

![](https://3743232000-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHW2IQuh2PFpWJDvBz2FF%2Fuploads%2Fgit-blob-abc3c4acc0ecc048b0f0fda062bcea21b1a6af16%2FScreenshot%202023-01-20%20at%2020.42.21.png?alt=media)

```javascript
function isPalindrome(string) {
  let s = 0
  let e = string.length - 1;
  while (s <= e) {
    if (string[s] !== string[e]) return false;
    s++;
    e--;
  }

  return true;
}

// Do not edit the line below.
exports.isPalindrome = isPalindrome;
```
