Having a list (array) of tags [\'tag1\', \'tag2\', \'tag3\'] I want to generate a nice title like: Content tagged tag1, tag2 and tag3.
[\'tag1\', \'tag2\', \'tag3\']
Content tagged tag1, tag2 and tag3
For the
From my view, This is an simple approach
var tags = ['tag1', 'tag2', 'tag3']; console.log("Content tagged " + tags.slice(0, -1).join(', ')+' and '+tags.slice(-1));
Hope it helps you :) JsFiddle