I have an array of strings and I would like to display them as a comma separated string but add "and" for the last element. For example I have
var fruits = ["Banana", "Orange", "Apple", "Mango"];
var energy = fruits.join(' ,');
outputs
'Banana, Orange, Apple, Mango'
Is there any way the I add "and" for the last word so it outputs
'Banana, Orange, Apple and Mango'
.reduceor replace the last comma in the string.