joined and split arrays in javascript