I have a collection of phrases that looks like this.
['white t-shirt', 'blue jeans', 'red hat', 'brown glasses'...]
I am looking for a way to insert these phrases into the text below, separated by commas, with the word "and" before the last item, like so:
'Your package includes a white t-shirt, blue jeans, red hat and brown glasses. You are all set to proceed to the checkout page.'
Since the phrases will be coming from the backend dynamically, I need to find a method that can generate this text without using a loop. Is there an alternative approach to achieve this?