First, I found a thread on this topic, but it was closed and did not address the issues that I want to ask about. I hit the wall trying to find my error on this exercise. I’m posting images instead of code because posting code doesn’t allow me to draw attention to specifics. I can highlight things in images. I understand that posting actual code is preferred but has its limits, IMO.
Buckle up. This might take a while.
In this screenshot I copied the instructions which I think are less than clear. I inferred, though the instructions didn’t say so, that I would have to declare variables -
sentence
and wordBlanks
- because they didn’t exist in the code given. Did I misunderstand what was meant? I thought I was to compose a proper sentence using constants provided. In order to do so I had to define a place to put it (const = "sentence"
). Because the instructions say to assign that sentence to workBlanks
. I think I did that using all of the constants - adjective, noun, verb, adverb and allowing for spaces between them as I point out in the next screenshot.
You will note at the lower left that the big “X” is my error. But what did I do wrong? First, I underlined in blue the declarations for the sentence and for the variable
wordBlank
and the code to set them the same. Next, I underlined in blue where I used each of the given constant values in constructing the sentence. Then drew green boxes around the areas that I left for spaces between the words. I even put a green box around the end of the sentence to show that I didn’t insert an unneeded space before the period.
I’ve looked at syntax until I can’t see it any more. I’ve looked at spelling and punctuation forwards and backwards. No doubt I’ve made a simple and stupid error, but I can’t find it despite the time I’ve spent looking at it and reading other articles on the web on the subject of js concatenation of strings.
I apologize for being verbose, but I didn’t know how else to convey what I’ve done and how I’ve struggled to find my error.
ps: why don’t the " ```" marks work in this post?