Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 16 lines (13 sloc) 281 Bytes
import { reduce } from './reduce';
export function join<T>(array: T[], joinWith: string) {
return reduce(
array,
(result, current, index) => {
if (index === 0) {
return current;
}
return `${result}${joinWith}${current}`;
},
'',
);
}
You can’t perform that action at this time.