# Build a Proofreading Tool - Build a Proofreading Tool

**URL:** <https://forum.freecodecamp.org/t/build-a-proofreading-tool-build-a-proofreading-tool/800531>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [September 19, 2026, 6:35am UTC](https://forum.freecodecamp.org/t/build-a-proofreading-tool-build-a-proofreading-tool/800531 "2026-09-19T06:35:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![isaacwillis](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/isaacwillis/32/421490_2.png) [@isaacwillis](https://forum.freecodecamp.org/u/isaacwillis)\
**Post date:** [September 19, 2026, 6:35am UTC](https://forum.freecodecamp.org/t/build-a-proofreading-tool-build-a-proofreading-tool/800531/1 "2026-09-19T06:35:49Z")

</div>

### Tell us what’s happening:

I can’t pass tests 12, 13, 17, and 18 and I’m not sure why. It seems to work fine when I test it.

### Your code so far

```js
function isPalindrome(word) {
  const lowerCase = word.toLowerCase();
  const reversedWord = lowerCase.split("").reverse().join("");
  return reversedWord === lowerCase;
}

function findPalindromeBreaks(words) {
  const nonPals = [];
  if (words) {
    for (let i = 0; i < words.length; i++) {
      if(isPalindrome(words[i])) {
        continue;
      } else {
        nonPals.push(i);
      }
    }
  }
  return nonPals;
}

function findRepeatedPhrases(words, phraseLength) {
  const repeats = [];
  const phrases = {};
  if (phraseLength >= words.length || phraseLength === 0) {
    return repeats;
  }

  for (let i = 0; i < words.length - phraseLength + 1; i++) {
    phrases[i] = words.slice(i, i + phraseLength).join(" ").toLowerCase();
  }

  for (const phrase in phrases) {
    for (const check in phrases) {
      if (phrases[phrase] === phrases[check] && phrase != check) {
        repeats.push(phrase);
      }
    }
  }
  return repeats;
}

function analyzeTexts(texts, phraseLength) {
  const analysis = [];
    for (const words of texts) {
      const repeatedPhrases = findRepeatedPhrases(words, phraseLength);
      const palindromeBreaks = findPalindromeBreaks(words);
      const textAnalysis = {repeatedPhrases, palindromeBreaks};
      analysis.push(textAnalysis);
    }
  return analysis;
}

```

### Your browser information:

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:156.0) Gecko/20100101 Firefox/156.0`

### Challenge Information:

Build a Proofreading Tool - Build a Proofreading Tool

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-v9/lab-proofreading-tool/build-a-proofreading-tool)**
>
> Learn to Code for Free

GitHub Link: [freeCodeCamp/curriculum/challenges/english/blocks/lab-proofreading-tool/69dd63d1dcdeccb7b39ba4c3.md at main · freeCodeCamp/freeCodeCamp · GitHub](https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/blocks/lab-proofreading-tool/69dd63d1dcdeccb7b39ba4c3.md)

---

<div class="post-metadata">

**Author:** ![sanity](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sanity/32/378897_2.png) [@sanity](https://forum.freecodecamp.org/u/sanity)\
**Post date:** [September 19, 2026, 7:50am UTC](https://forum.freecodecamp.org/t/build-a-proofreading-tool-build-a-proofreading-tool/800531/2 "2026-09-19T07:50:46Z")

</div>

If you look at the browser’s console (not the console on page), there are some details about failing tests.

As it turns out, the integer keys in objects are coerced to string, so returned `repeats` contains strings, instead of integers.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [September 21, 2026, 8:27am UTC](https://forum.freecodecamp.org/t/build-a-proofreading-tool-build-a-proofreading-tool/800531/3 "2026-09-21T08:27:08Z")

</div>

Closed on September 21, 2026, 8:27am UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
