    var initialValue = null;
    var object = {};

    function countBackward(){

        if (object.initialValue != 0) {
            object.initialValue = object.initialValue - 1
            document.getElementById(object.containerId).innerHTML = object.initialValue
        }
        else{
            if (object.redirectTo == null) {
                window.location.replace(object.redirectTo)
            }
            else{
                window.history.back()
            }
        }
    }

    function pageTimeOutCountDown(obj){
        object = {object, ...obj}

        if (object.initialValue == 0) {
            clearTimeout(count)
        }

        var count = setInterval(() => {
            countBackward()
        },1000)
    }