Chapter 2

Program Structure

This chapter introduces the basic concepts of programming. Control structures, functions, and data structures are covered. The chapter also explains how JavaScript is organized and how it differs from other programming languages. Here are the following assignments: 1) Write a loop that makes seven calls to output a triangle. 2)Write a program that print all the numbers from 1 to 100. For numbers divisible by 3, print Fizz, and for numbers 5, print Buzz. 3) Write a program that represents an 8×8 grid, using newline characters to separate lines.

Looping a triangle

Click Add/Remove button to show a little moon 🌝.

FizzBuzz

Introduce any sentence and see how it Fizz Buzzes.

Live typing display

Chessboard

Here is a jumper chessboard.

Looping a triangle

Tap + or - to update rows



FizzBuzz

Tap + or - to update number
11

Chessboard

Tap + or - to update rows