My JS looks like this:preLoadImages(/media/img/elements/frontpage/1.jpg,/media/img/elements/frontpage/2.jpg,/media/img/elements/frontpage/3.jpg,/media/img/elements/frontpage/4.jpg,/media/img/elements/frontpage/5.jpg,/media/img/elements/frontpage/6.jpg,/media/img/elements/frontpage/7.jpg,/media/img/elements/frontpage/8.jpg,/media/img/elements/frontpage/9.jpg,/media/img/elements/frontpage/10.jpg);What would be a better way to do this?var directory = /media/img/elements/frontpage/preLoadImages(directory+1.jpg,directory+2.jpg,directory+3.jpg,directory+4.jpg,directory+5.jpg,directory+6.jpg,directory+7.jpg,directory+8.jpg,directory+9.jpg,directory+10.jpg);Doesn't seem much better. There must be a zip/map/join type thing I can use here?
Combining text in an array in JavaScript
javascript