Refresh page automatically

I have a function which is triggered by clicking a button. To use the function again properly, I always have to refresh. How do I automatize this "refresh"

This is the trigger
document.getElementById("choose").addEventListener("click", branchenCheck);

And this is the function

let resultBranche = [];
let resultThema = [];

function branchenCheck(selectedBranche, selectedThema) {
    for (var i = 0; i < kandidaten.length; i++) {
        for (key in kandidaten[i]) {
            if (kandidaten[i][key].indexOf(selectedBranche) != -1) {
                resultBranche.push(kandidaten[i]);
            }
        }
    }
    themenCheck(resultBranche)
}

I read of “location.reload();” But I have no idea how to implement this or whether it is neccessary to implement.

Just call location.reload() at the point in the code you want to reload the page, that’s it. Here are 534 other ways to reload the page as well:

http://www.phpied.com/files/location-location/location-location.html

You were not kidding :zipper_mouth_face: