Java Reference
In-Depth Information
Chapter
2
Programming Basics
In the last chapter, we introduced JavaScript and set up a programming environment where
we got our hands dirty with a few JavaScript programs. In this chapter, we're going to delve
further to learn how JavaScript works, and start writing some programs.
We'll cover the following topics:
• the importance of well-commented code
• JavaScript grammar―expressions, statements, semicolons, and whitespace
• primitive data types
• strings―string literals and string methods such as length
• variables―declaring and assigning
• numbers―decimal, hexadecimal, octal and exponent form, Infinity, and NaN
• arithmetic operations such as +, -, *, /, and %
• undefined and null
• Booleans―truthy and falsy values
• logical operators―AND, OR, and NOT
• our project―where we'll set some question and answer variables and use alert
boxes to display them
Search WWH ::




Custom Search