English | 2015 | ISBN: 978-0993836701 | 133 Pages | EPUB | 10 MB
If you answer YES to one or more of the following questions, this book is for you
- I am a complete programming beginner
- I know a little HTML and CSS
- I find programming books boring
- I can’t focus long enough reading technical texts
- I need to start really slow
- I am a graphic and/or web designer
- I am a parent who wants to spark an interest in programming in my kids
WHAT WILL I LEARN?
- The syntax of the language
- The most important concepts
- Programming terminology
- Basics of the object oriented programming
- To exercise regularly
Statements are commands that are executed one by one in the same order they are written, unless they are conditional statements. We have been using them for a while and they are separated by semicolon. So, even declaring and assigning a value to a variable is a statement on its own.
Here the block statement is interfering with the code outside, which is why the output is 2 instead of 1.
The Conditional statements are the ones that run only when their condition is met. More details on that will follow in a later chapter.
Another type of statement is the Exception Handling. They are used to work around with exceptions by using the throw statement andt then handling them with the try … catch statement.
When you throw an exception, you specify the expression containing the value to be thrown. Also, you can throw any expression, string, number, Boolean, and even functions!
With the usage of id in your HTML, you have access to specific nodes instead of just all the nodes of a certain type. That is why it is recommended to have different id names, to allow for more precise control.
To work with a particular id, you use the getElementById method,