var images_array =
[
"bathroom-cat.jpg",
"box-cat.jpg",
"bullet-cat.jpg",
"cat.jpg",
"kitten.jpg",
"kitten2.jpg"
]
var imageNames =
[
"The power of Cleanliness| PWR: 6",
"Cardboard Condemption| PWR: 5",
"Bullet Cat| PWR: 7",
"The Glare| PWR: 8",
"Bue Eye Emplosion| PWR: 6",
"Adorable Annihilation| PWR: 10"
]
var idNames =
[
"hero1",
"hero2",
"hero3",
"op1",
"op2",
"op3"
]
var obj1 = { id: "AAA", img : images_array, imgN :imageNames, idN : idNames[0] };
var obj2 = { id: "BBB", img : images_array, imgN :imageNames, idN : idNames[1] };
var obj3 = { id: "CCC", img : images_array, imgN :imageNames, idN : idNames[2] };
var obj4 = { id: "DDD", img : images_array, imgN :imageNames, idN : idNames[3] };
var obj5 = { id: "EEE", img : images_array, imgN :imageNames, idN : idNames[4] };
var obj6 = { id: "FFF", img : images_array, imgN :imageNames, idN : idNames[5] };
function myFn(JSobject) {
var randomNum = Math.floor(Math.random() * JSobject.img.length)
document.getElementById(JSobject.id).src = "images/" + JSobject.img[randomNum];
document.getElementById(JSobject.idN).innerHTML = JSobject.imgN[randomNum];
}
function bodyOnload() {
myFn (obj1);
myFn (obj2);
myFn (obj3);
myFn (obj4);
myFn (obj5);
myFn (obj6);
}
ArrayArray.from()Array.isArray()Array.observe()Array.of()Array.prototype.concat()Array.prototype.copyWithin()Array.prototype.entries()Array.prototype.every()Array.prototype.fill()Array.prototype.filter()Array.prototype.find()Array.prototype.findIndex()Array.prototype.forEach()Array.prototype.includes()Array.prototype.indexOf()Array.prototype.join()Array.prototype.keys()Array.prototype.lastIndexOf()Array.prototype.map()Array.prototype.pop()Array.prototype.push()Array.prototype.reduce()Array.prototype.reduceRight()Array.prototype.reverse()Array.prototype.shift()Array.prototype.slice()Array.prototype.some()Array.prototype.sort()Array.prototype.splice()Array.prototype.toLocaleString()Array.prototype.toSource()Array.prototype.toString()Array.prototype.unshift()Array.prototype.values()Array.prototype[@@iterator]()Array.unobserve()get Array[@@species]FunctionObjectObject.prototype.__defineGetter__()Object.prototype.__defineSetter__()Object.prototype.__lookupGetter__()Object.prototype.__lookupSetter__()Object.prototype.hasOwnProperty()Object.prototype.isPrototypeOf()Object.prototype.propertyIsEnumerable()Object.prototype.toLocaleString()Object.prototype.toSource()Object.prototype.toString()Object.prototype.unwatch()Object.prototype.valueOf()Object.prototype.watch()Object.setPrototypeOf()