name_slice = function (name_arr, end_index) {
        return name_arr.slice(0, end_index + 1).join(",");
    }
Slices an array, returns a string by joining the sliced elements.
 @example
  > name_slice(['TC1', 'TC1.1', 'mytest'], 1);
  "TC1,TC1.1"