solution of exam problem - JavaScript Basics 11/25/2014