Didnt pass test

Hi, i dont know why this dont pass the test

<p class="bio">${bio.length > 50 ? `${bio.slice(0, 49)}...` : bio}</p>

It displays correctly on the page, but tests dont pass.

remember that slice extracts up to but not including end . Right now you are extracting characters from index 0 to index 48

you need to fix this part here to include the correct numbers

hope that helps

<p class="bio">${bio.length > 50? `${bio.slice(0,50)}...` : bio}</p>
If the bio text is greater than 50 characters, you should extract the first 50 characters with slice() and replace the rest with .... Don't forget that indexes are zero-based.

I did try that before but test still didnt pass. Is there an error with the ellipsis?

It looks like there is an issue with the tests.
it is looking for this fixed solution

<p class="bio">${bio.length > 50 ? bio.slice(0, 50) + '...' : bio}</p>

I’ll create an issue to report this

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