Answers for "join last element of array javascript with different value"

2

join last element of array javascript with different value

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

join last element of array javascript with different value

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

Code answers related to "join last element of array javascript with different value"

Code answers related to "Javascript"

Browse Popular Code Answers by Language