function toSentence(arr){
if(arr.length===1)return `There is 1 doc ${arr[0]}`;
const last = arr.pop();
const others=arr.join(", ");
return `There are docs ${others} and ${last}`
}
2
solved Create simple text string from array typescript
function toSentence(arr){
if(arr.length===1)return `There is 1 doc ${arr[0]}`;
const last = arr.pop();
const others=arr.join(", ");
return `There are docs ${others} and ${last}`
}
2
solved Create simple text string from array typescript