Test Your Knowledge

  1. How are Boolean values handled differently by PHP and JavaScript?

  2. What is the difference between unary, binary, and ternary operators?

  3. What is the best way to force your own operator precedence?

  4. When would you use the === (identity) operator?

  5. What are the simplest two forms of expressions?

  6. Name the three conditional statement types.

  7. How do if and while statements interpret conditional expressions of different data types?

  8. Why is a for loop more powerful than a while loop?

  9. What is the purpose of the with statement?

  10. How can you let JavaScript deal gracefully with an error when it encounters one?

See Chapter 14 Answers in Appendix A for the answers to these questions.

Get Learning PHP, MySQL, JavaScript, and CSS, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.