O'Reilly logo

Exam Ref 70-480: Programming in HTML5 with JavaScript and CSS3 by Rick Delorme

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Implement program flow

Being able to manipulate the Document Object Model (DOM), create animations, and use the various application programming interfaces (APIs) provided by the JavaScript library is a great skill to have. To leverage the power of the user experience fully, however, you need to provide users with certain website functions only under certain conditions, a concept known as program flow. Without program flow, JavaScript programs would process from top to bottom in the order in which the code was written. This is useful in some cases, but in most situations in which a dynamic user experience is required, logic needs to be processed conditionally. Program flow can be conditional, iterative, or behavioral:

Conditional

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required