JS arrays and functions homeworks