I need to implement a string concatenate function, the functionality shows below,
function concatenation(original: string, name1?, name2?){
return original + name1 + name2;
}
However, the question is, there can be more parameters about name; therefore, this is a not a good coding style. I want to change its like shows below.
function concatenation(original: string, name?:[string]){
return original + ...name1;
}
But in this way, the program will report an error. How could I achieve it?