completes JS exercise