// Generate an array of length 5 with random numbers ranging from 2 to 32, using recursion
let arr = new Array(5);
// Generate a random number
let random = (min, max) = > {
    return Math.floor(Math.random() * (max - min + 1) + min);
}
let len = arr.length
while(len) {
    let randomNumber = random(2.32)
    if (arr.indexOf(randomNumber) === -1) {
        arr[len-1] = randomNumber; len--; }}console.log(arr)
Copy the code