You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.
Not sure why you think that is incorrect code. The challenge is to solve a specific problem using template literals, whether to map, loop or use another method on the result array or hardcode references to the array is up to the camper. There is no requirement to consider anything other than the provided 3 element array - result.failure
I just think that allowing a solution like this teaches a bad practice as it only works correctly if the array passed has exactly three values. What if your failures array has four values? The 4th value would not be displayed.
I get that the point of this challenge is to teach template literals and this answer does show an understanding of that principle. But if I look at this and ask myself if it's good code, I would argue that it isn't. Maybe the solution to this issue is to just rework the challenge itself so that it is more focused on template literals.
Another thing to think about is that when b8d004e goes to production you will be able to paste the existing comment from the challenge into your function and get it to pass as shown below.
functionmakeList(arr){"use strict";// change code below this lineconstresultDisplayArray=null;// change code above this linereturn[`<li class="text-warning">no-var</li>`,`<li class="text-warning">var-on-top</li>`,`<li class="text-warning">linebreak</li>`];}
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
The challenge passes if you hardcode three array values into your function.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
This is problematic because the given function will not work with arrays that have more or less than 3 values.
The text was updated successfully, but these errors were encountered: