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

Incomplete details about how to complete challenge : Create String using Template literal #17633

Closed
mpmaan opened this issue Jun 19, 2018 · 8 comments

Comments

@mpmaan
Copy link
Contributor

mpmaan commented Jun 19, 2018

Describe your problem and - if possible - how to reproduce it

It is not mentioned that we should use map() function to solve it. The test Template strings were used fails if we use a for-loop to solve this challenge. I could pass it by using only map() function.

This code works

   const resultDisplayArray = arr.map((item) => `<li class="text-warning">${item}</li>`);

This doesn't work

    const resultDisplayArray = [];
    for(let i = 0; i < arr.length; i++){
        resultDisplayArray.push(`<li class="text-warning">${arr[i]}</li>`);
    }

Most probably the regex test fails because of the [ and ] characters while using for-loop.

Also, the $ characters are not rendered properly in the given example in the guide.
The example should have ${person.name} and ${person.age}.

Add a Link to the page with the problem

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/create-strings-using-template-literals/

Tell us about your browser and operating system

  • Browser Name: Google Chrome
  • Browser Version: 60+
  • Operating System: Ubuntu 18.04

If possible, add a screenshot here

screenshot from 2018-06-19 17-03-28

@Nirajn2311
Copy link
Member

Hmmm, the code appears to be correct in seed, but is not formatted correctly in the webpage.

@mpmaan
Copy link
Contributor Author

mpmaan commented Jun 19, 2018

@Nirajn2311 Also check this challenge , it has kind of simlar problem (see $ in second example).
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/use-capture-groups-to-search-and-replace/

@Nirajn2311
Copy link
Member

I’ll see what I can do about the typos.
For everyone, I would appreciate if you told me all typos anyone finds as I am fixing it at curriculum repo(freeCodeCamp/curriculum#23).

@mpmaan
Copy link
Contributor Author

mpmaan commented Jun 22, 2018

@Bouncey The issue with $ sign may have been fixed but what about the map() function ?

@scissorsneedfoodtoo
Copy link
Contributor

@mpmaan, thank you for pointing out the issue with the formatting caused by MathJax. That was my fault for not checking how it affected all the challenge descriptions outside of the Interview Prep sections.

You're right that there is still an issue with this challenge due to the regex in the test being to specific. You can follow the discussion here: #16358

I plan on submitting a fix from one of my comments in that issue.

@mpmaan
Copy link
Contributor Author

mpmaan commented Jun 22, 2018

@scissorsneedfoodtoo thanks, i am sorry for creating duplicate issue.

@scissorsneedfoodtoo
Copy link
Contributor

@mpmaan, no worries! Better a duplicate issue than one going completely unreported. Good looking out!

@youngtechlove
Copy link

Hi im looking for anyone willing to help me out with some training tips and how i can improve myself at code entry's

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

No branches or pull requests

4 participants