JSFiddle - React, Tailwind, and code Playground

by Chance Nursey-Bush

JavaScript

var tries = 5;
		
    var timeOut;
    
    timeOut = function(){
     console.log(tries);
    if (!window.grepcatcha && tries > 0) {
    console.log("if (!window.grepcatcha && tries > 0)");
    tries--;
    window.setTimeout(timeOut, 1000);
    } else if(window.grepcatcha){
    console.log("loaded on " + (6-tries) + " try")
    } else {
    console.error("couldn't load recaptcha library");
    }
    }
    
timeOut();