Ninth exercise for javascript