HTML and CSS Reference
In-Depth Information
In the next session, you'll explore how to work with JavaScript's conditional state-
ments and put together everything you've learned to complete the calendar() function.
Session 12.2 Quick Check
1.
What is a program loop? Name three types of program loops supported by
JavaScript.
2.
Provide a
for
statement to use a counter variable named
i
that starts with the
value 0 and continues up to 100 in increments of 10.
3.
Provide a
for
statement that creates a table row consisting of five table cells.
Assume the table cells display the text
Column
i
, where
i
is the value of the
counter variable, and the value of the counter variable increases from 1 to 5 in
increments of 1.
4.
Provide code to duplicate the task in the previous question using a
while
loop.
5.
Show how to use an array method introduced in ECMAScript 5 to increase the
value of each item in the array
x = [2, 14, -3, 7]
by 10.
6.
Show how to use an array method introduced in ECMAScript 5 to map the value
of items in the array
x = [2, 14, -3, 7]
into a new array named
y
in which
each of the values is increased by 10.
7.
Show how to use an array method introduced in ECMAScript 5 to return a
Boolean value indicating whether every value in the array
x = [2, 14, -3, 7]
is positive.
8.
Show how to use an array method introduced in ECMAScript 5 to store only the
positive values from the array
x = [2, 14, -3, 7]
in a new array named
y
.