O'Reilly logo

JavaScript Programmer's Reference by Jonathan Reid, Thomas Valentine

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 6

image

JavaScript Control Statements Reference

Introduction

As we discussed in Chapter 2, JavaScript has the usual control statements you would expect for a C-like language:

  • do loops
  • for and for/in loops
  • while loops
  • if-else conditionals
  • switch conditionals

In addition, JavaScript provides ways to manage your loop iterations, break out of loops entirely, and even limit the scope of your loops.

In this chapter we’ll provide a solid reference for all JavaScript control statements, in alphabetical order. For detailed discussions of these statements, see Chapter 2.

break

The break statement terminates the current loop or the current label or ...

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