Homework for JavaScript course