consolidated JavaScript exercises