A beginner's attempt at learning JavaScript