<script>
var images = new Array()
function preload() {
for (i = 0; i < preload.arguments.length; i++) {
images[i] = new Image()
images[i].src = preload.arguments[i]
}
}
preload(
"https://i.imgur.com/AJDZEOX.jpg",
"https://i.imgur.com/b3Rqi4d.png",
"https://i.imgur.com/96Q10GA.png",
"https://i.imgur.com/WzHsnG7.png",
"https://i.imgur.com/CzqEXBq.jpg",
"https://i.imgur.com/fOfpsiC.png",
"https://i.imgur.com/b3Rqi4d.png"
)
</script>
What does this mean?
If you use this solution, don’t forget the var statement for the i-variable. Otherwise it will be set globally which can cause error that are really hard to solve (unless you know that you forgot the var statement. for (var i = 0.....
Also, how do you put this into jslint?
var images = new Array()
function preload() {
for (i = 0; i < preload.arguments.length; i++) {
images[i] = new Image()
images[i].src = preload.arguments[i]
}
}
preload(
)