No worries. It is hard to notice every little detail. I was staring at your code and thought that it should work. Then I myself went to the challenge and wrote solution which ended up being exactly the same as yours. And was like WTF it is all the same Sometimes just re-writing the same thing from the scratch can help.
but I keep getting invalid regular expression flags? I have backticks around the li class and /li but they are not showing properly for some reason here.
Everything displays properly on my Visual Studio program but getting an error in FCC challenge. Any help? Thanks.
I made a screenshot, for some reason looks like the program is not recognizing the template string. Everything recognizes fine in my Visual Studio. Or am I missing something else?
Same here. I can’t figure out why it says invalid regular expression flags even though I used template literals in my code. My solution is very similiar to yours as you can see below.
It seems that you have been doing everything right, but there is a bug with the challenge itself. I would move on from the time being and work on other challenges while this one is fixed.
Here is a thread you can follow work updates on this issue:
Just saw this thread…They are asking for work using backticks. It’s pretty simple. The format is layed out below the code. It’s backticks practice. I realize my answer is the bug-answer. Yep.
Hi all, I’m a newb to this. But here’s my understanding with the requirements. Thought I should share this to help you as a newb-point-of-view.
Understanding the requirements:
resultDisplayArray should be an array containing result failure messages.
The result should be an “array” with the elements from result.failure.
(This should be not limited to .failure, should work also to other elements of result object)
resultDisplayArray should be equal to the specified output.
Nothing much of it, we’re pretty much aware what is the specified output. The <li> output as an element of an “array”.
Template strings and expression interpolation should be used.
Apply the template strings - back tick and the ${variable}
(This is what the lesson is for so it should not be missing as a requirement.)
An iterator should be used.
This was explained in the problem. To use some sort of loop.
Creating the solution:
Turn the declaration into an array. Since the array has no element yet, I use [ ].
Check the specified output. I should return the <li> as a string element (assumed, due the presence of single quotes) of the array.
Just use the “back tick” (instead of “quote” type of string). With that, I could use ${variable} too.
Just check the pattern of every elements. Create a loop for this. (Coding for each element one by one is the first solution I could think. But it will not pass the #4 requirement. Loop should make your code neat and simple as one of its functions - but bruh, seriously?!)