JavaScript Programming Basics


Notes for Instructors

This series of labs presents elementary programming concepts using the JavaScript language. Students build three different web pages or programs: a guestbook, an "expert advice system" or decision tree, and a CD order form.

There are two categories of labs in the series.

Since the purpose of the mini-labs is immediate practice of new concepts immediately after they have been introduced, the instructions in the mini-labs are more explicit than those in the full-length labs.

These labs would be appropriate in courses on web page development, broad overview ("CS 0") courses, or elementary programming courses.

First Programming Lab: JavaScript Objects

Mini-Lab 1: Functions - Units of Computation

Mini-Lab 2: Variables - Creating and Naming Objects

Mini-Lab 3: If Statements - Decisions, Decisions

Second Programming Lab: Implementing an Expert System

Mini-Lab 4: Arrays - Containers of Objects

OPTIONAL: Programming Project #1: Expert System with Arrays

Mini-Lab 5: Loops - Doing It Over and Over and ...

Third Programming Lab: Sorting CD Information

OPTIONAL: Programming Project #2: CD Order Form

Miscellaneous Notes

You may find it useful to print and copy all of the labs and mini-labs as a hard-copy lab manual for your students. At Kalamazoo College, we do this at the beginning of the quarter and require students to buy it at the bookstore for the price of the copying.

If you would like to see the context in which we offer these labs, including the lecture notes for the "mini-lectures" that precede the mini-labs, the web page for our entire course is
This is the link to the current course, so it is always changing. To see a stable version of the course's web site, look at an old version. For example, the Spring 99 version would be found at
All past quarters since Fall 1997 are still online; just substitute F for Fall, W for Winter, or S for Spring, and the last 2 digits of the year.

The amount of time the labs require will depend on many things, including the background of your students and whether the labs follow one another consecutively or you have the students working on other exercises in between. At Kalamazoo College, classes meet three times a week for one hour and fifteen minutes. Students also meet in a closed lab for two hours, once a week. We integrate the mini-labs into our lecture time; we introduce the topic in the first 20 minutes or so, and then the students work on the mini-lab in pairs for approximately 40 - 50 minutes. The programming labs are scheduled during our weekly closed lab time, and we allow students the full two hours. Students may work on the programming labs individually or in pairs.

A paper about these labs, "Using Web Page Development to Teach Programming Concepts," was published in The Journal of Computing in Small Colleges, Vol. 13, No. 5 (May 1998). The associated presentation given at the Third Annual Northeast Conference of the Consortium for Computing in Small Colleges is available online at

Please send comments to Alyce Faulstich Brady:

Alyce Faulstich Brady (
Kelly Schultz (
R.C. McDowell (

Kalamazoo College
Kalamazoo, Michigan