Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced Solution on FCC Guides does not work - "Truncate A String" #34216

Closed
Melvin-Viana opened this issue Nov 5, 2018 · 2 comments · Fixed by #34228
Closed

Advanced Solution on FCC Guides does not work - "Truncate A String" #34216

Melvin-Viana opened this issue Nov 5, 2018 · 2 comments · Fixed by #34228

Comments

@Melvin-Viana
Copy link
Contributor

Describe your problem and how to reproduce it:
Advanced solution on the freeCodeCamp guides for the "Truncate A String" challlenge does not work.
See links below.

Add a Link to the page with the problem:
https://guide.freecodecamp.org/certifications/javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string/
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string

Tell us about your browser and operating system:

  • Browser Name: Google Chrome
  • Browser Version: 70.0.3538.77
  • Operating System: Windows 10

If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):

@Melvin-Viana
Copy link
Contributor Author

I copied and pasted the advanced solution and it does not work. Perhaps the challenge has been changed.

@Melvin-Viana Melvin-Viana changed the title Advanced Solution does not work Advanced Solution on FCC Guides does not work - "Truncate A String" Nov 5, 2018
@Melvin-Viana
Copy link
Contributor Author

Melvin-Viana commented Nov 5, 2018

This was my solution for anyone who wants to fix the FCC docs in:
https://guide.freecodecamp.org/certifications/javascript-algorithms-and-data-structures/basic-algorithm-scripting/truncate-a-string/

const truncateString=(str, num) =>
   (str.length>num)?`${str.slice(0,num)}...`:str;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant