0

Just a quick question: Can I call the same function within a function?

function rIN() {
    randomImgNumber = (Math.round(imgNumber * Math.random())) - 1;
    if (randomImgNumber === "undefined") {
        rIN();
    }
    return imgArray[randomImgNumber];
}

If not, is there another way I can redo the same function inside a function?

I'm sorry if this is a bad question, I am a beginner in coding.

Anik Islam Abhi
  • 25,137
  • 8
  • 58
  • 80
Stardust
  • 999
  • 3
  • 12
  • 24

0 Answers0