Sign in Go Pro

Beginning JavaScript for React Native

Looping with For and While


Up next



Basic loops in JavaScript can be accomplished with for or while.

For loops will loop a variable from one value to another (like for loops in c) - whereas while loops will loop for as long as a condition is met.

React Native applications rarely actually use for or while loops however - because most looping is done by iterating over data in an array or object. Looping over arrays and objects is most often accomplished with forEach or map.

Summary of Content:

  • Creating a basic for loop
  • Variable scopes within loops
  • Defining a while loop
  • Using break and continue to modify the operation of loops




There are no comments on this lesson, start the conversation below ...

You need to go PRO to post comments.

Lessons in Beginning JavaScript for React Native