join and split arrays/strings in js