SOURCE

const randomImg=()=>{
    const source=[
            "https://www.helloimg.com/image/Zsvl0c"
            ,"https://www.helloimg.com/image/Zsvb4h"
            ,"https://www.helloimg.com/image/ZsvHGm"
            ,"https://www.helloimg.com/image/ZsviD0"
            ,"https://www.helloimg.com/image/ZsvSb5"
            ,"https://www.helloimg.com/image/ZsvLaA"
            ,"https://www.helloimg.com/image/Zsv4gz"
            ,"https://www.helloimg.com/image/Zsvt9R"
            ,"https://www.helloimg.com/image/Zsvsxn"
            ,"https://www.helloimg.com/image/ZsvJh6"
            ,"https://www.helloimg.com/image/ZsvE0P"
            ,"https://www.helloimg.com/image/Zsvx4M"
            ,"https://www.helloimg.com/image/ZsvqCg"
            ,"https://www.helloimg.com/image/ZsvXDX"
            ,"https://www.helloimg.com/image/Zsv3H9"
            ,"https://www.helloimg.com/image/Zsv1PY"
            ,"https://www.helloimg.com/image/ZsvPgE"
            ,"https://www.helloimg.com/image/ZsvFWv"
            ,"https://www.helloimg.com/image/Zsvoqu"
            ,"https://www.helloimg.com/image/ZsvRht"
            ,"https://www.helloimg.com/image/ZsvGwQ"
            ,"https://www.helloimg.com/image/ZsvC4C"
            ,"https://www.helloimg.com/image/ZsvBCS"
            ,"https://www.helloimg.com/image/Zsdy7D"
            ,"https://www.helloimg.com/image/ZsduHo"
            ,"https://www.helloimg.com/image/ZsdjPb"
            ,"https://www.helloimg.com/image/ZsdfUK"
            ,"https://www.helloimg.com/image/ZsdYW1"
            ,"https://www.helloimg.com/image/ZsdVqT"
            ,"https://www.helloimg.com/image/Zsdkfr"
            ,"https://www.helloimg.com/image/Zsdgwq"
            ,"https://www.helloimg.com/image/ZsdUtc"
            ,"https://www.helloimg.com/image/ZsdKBh"
            ,"https://www.helloimg.com/image/Zsd67m"
            ,"https://www.helloimg.com/image/ZsdIn0"
            ,"https://www.helloimg.com/image/ZsdDP5"
            ,"https://www.helloimg.com/image/ZsdzUA"
            ,"https://www.helloimg.com/image/ZsdpTz"
            ,"https://www.helloimg.com/image/ZsdQqR"
            ,"https://www.helloimg.com/image/Zsd0fn"
            ,"https://www.helloimg.com/image/Zsdwv6"
            ,"https://www.helloimg.com/image/ZsdvtP"
            ,"https://www.helloimg.com/image/ZsddBM"
            ,"https://www.helloimg.com/image/ZsdOzg"
            ,"https://www.helloimg.com/image/Zsd9nX"
            ,"https://www.helloimg.com/image/ZsdWF9"
            ,"https://www.helloimg.com/image/Zsd2KY"
            ,"https://www.helloimg.com/image/ZsdMTE"
            ,"https://www.helloimg.com/image/Zsdlev"
            ,"https://www.helloimg.com/image/ZsdHYu"
            ,"https://www.helloimg.com/image/Zsc8cu"
            ,"https://www.helloimg.com/image/Zsc6mt"
            ,"https://www.helloimg.com/image/ZscDyQ"
            ,"https://www.helloimg.com/image/Zsc7pC"
            ,"https://www.helloimg.com/image/ZsczSS"
            ,"https://www.helloimg.com/image/ZscpZD"
            ,"https://www.helloimg.com/image/ZscN8o"
            ,"https://www.helloimg.com/image/Zsc0Mb"
            ,"https://www.helloimg.com/image/Zscw3K"
            ,"https://www.helloimg.com/image/ZscdV1"
            ,"https://www.helloimg.com/image/ZscccT"
            ,"https://www.helloimg.com/image/ZscOJr"
            ,"https://www.helloimg.com/image/ZscWyq"
            ,"https://www.helloimg.com/image/ZscTQc"
            ,"https://www.helloimg.com/image/Zsc2Lh"
            ,"https://www.helloimg.com/image/ZscMZm"
            ,"https://www.helloimg.com/image/Zscb60"
            ,"https://www.helloimg.com/image/ZscHM5"
    ];
    // let imgs=[...source];
    let imgs=[];
    return (index)=>{
        if(!imgs.length){
            imgs=[...source]
        }
        let max=imgs.length;

        return imgs.splice(~~(Math.random()*(max-0)+0),1);
    }
}
Array(20).fill(null).forEach(()=>console.log(~~(Math.random()*(2-0)+0)))

console.log(randomImg()())
console.log(randomImg()())
console.log(randomImg()())
console.log(randomImg()())
console 命令行工具 X clear

                    
>
console