I am trying to display a random array of images in the UI, but I'm encountering an error with innerHTML when using the code below in TypeScript.
randomPic(){
this.randomNum= Math.floor(Math.random() * this.myPix.length);
console.log(this.randomNum)
return document.getElementById('myPicture').innerHTML= '<img src="'+this.myPix[randomNum]+'" />';
}
Could someone please assist me in identifying where I may be going wrong?