I am stuck on Step 6. My code is correct and
the console shows the right output but the test
keeps failing with “parseCard should return
trimmedParts”.
My code:
function parseCard(rawString) {
const parts = rawString.split(“|”);
const trimmedParts = ;
for (let i = 0; i < parts.length; i++) {
trimmedParts.push(parts[i].trim());
}
return trimmedParts;
}
I have tried hard refresh, incognito, disabling
extensions and resetting the step. Nothing works.
The code that’s showing looks correct and since you’ve already reset this step, I can only suggest our standard response, most of which you’ve already done. But here it is, in case you’ve overlooked something:
Your solution works from my end. Please try one of the following steps to move forward.
Click on the “Restart Step” button and force a refresh of your page with CTRL + F5 then try to paste the code in again.
or - Try the step in incognito or private mode.
or - Disable any/all extensions that interface with the freeCodeCamp website (such as Dark Mode, Ad Blockers, or Spellcheckers), and set your browser zoom level to 100%. Both of these factors can cause tests to fail erroneously.
or - Ensure your browser is up-to-date or try a different browser.