Question: I need help removing the added images at random intervals Assignment prompt: One of the few tasks which remains is to make the randomly appearing

I need help removing the added images at random intervals
Assignment prompt: One of the few tasks which remains is to make the randomly appearing images, disappear at random! Each randomly added image should also disappear after a separately random time. There are several techniques which would solve this problem. Any will do. One such method requires you to generate unique IDs dynamically.
Here is my code:
function addImage(){
let xPos = getX();
let yPos = getY();
$("#gamespace").append('');
count ++;
addImageInterval = setTimeout(addImage, randImage(0,2000));

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!