Hi Juanita:
Good to hear you sorted it out. I think you are based in the US, I’m in the UK so hard to respond to questions in real time except where our days overlap!
One thing that I will suggest is that you take a look at the training material on this site:
When you get to this page there is a menu of different web technologies across the top of the page
This is all free reference and tutorial material on most things you might need help with when using languages such as Javascript. Also stackoverflow.com can be a useful reference site. But make sure you don’t ask questions that have already been answered, the community will let you know in no uncertain terms if you do that. But this is a great resource if you want to get an answer to many problems. Simply search for the error you are seeing and someone is likely to have asked about it and received an answer.
Now the use of curly braces is addressed here: JavaScript Statements
Basically you need to make sure that you always keep the braces matching because they define a code block.
i.e. { } are matched and define a block. { without } is an open block and confuses the javascript interpreter as I mentioned above.
So when we write code we generally use indentation to help us figure out that we have matching braces.
If it makes it easier, adding comments can also help you figure out where there is a problem.
Can you see the problem with the example below?
{ // Start Main block
{ // Start Block 1
{ // Start Block 2
} // End Block 2
} // End Block 1
{ // Start Block 3
{ // Start Block 4
{ // Start Block 5
} // End Block 4
} // End Block 3
} // End Main Block
As you get more experienced you will see how others write their code, or encounter coding standards that are designed to help others read your code and make the code easier to debug ![]()
Hope this is helpful.