Answers for "join string js with and at the last item"

0

join string js with and at the last item

['tom', 'dick', 'harry'].join(', ').replace(/, ([^,]*)$/, ' and $1')
> "tom, dick and harry"
Posted by: Guest on September-29-2021

Code answers related to "join string js with and at the last item"

Code answers related to "Javascript"

Browse Popular Code Answers by Language