Array.prototype.map
is a great tool for this kind of things:
arr.map(function(el) {
return 'images/' + el;
})
In ES2015+:
arr.map(el => 'images/' + el)
Array.prototype.map
is a great tool for this kind of things:
arr.map(function(el) {
return 'images/' + el;
})
In ES2015+:
arr.map(el => 'images/' + el)