Worked on splitting and joining arrays in JavaScript