Closed EmilyMB closed 9 years ago
This was kind of enlightening.... and I think semi-colons as a general rule follow expressions?
An expression produces a value and can be written wherever a value is expected—for example, as an argument in a function call or at the right side of an assignment. Each of the following lines contains an expression: myvar 3 + x myfunc('a', 'b')
Roughly, a statement performs an action. Loops and if statements are examples of statements. A program is basically a sequence of statements.[6] Wherever JavaScript expects a statement, you can also write an expression. Such a statement is called an expression statement. The reverse does not hold: you cannot write a statement where JavaScript expects an expression. For example, an if statement cannot become the argument of a function.
Honestly, this one was a little advanced for my 'style of JS'... It seems like there is probably good stuff in here with more exposure, and hopefully reading through it will subconsciously trigger something if I run in to one of these situations. I've definitely got it bookmarked as a 'to be re-read'.
I found a couple things to be interesting but over all not very helpful for a novice such as myself.
I felt semi-comfortable at the beginning of this read. About two paragraphs later I felt pretty lost. I kind of moved towards another source to get a better foundation. I started reading this free book. http://www.it-ebooks.info/book/483/
Discuss JavaScript Garden here.