// check if the first visit cookie exists
function filterPredicate (item) {
    return item.trim().indexOf('firstVisit') === 0;
}

// set the cookie according to the condition
if (document.cookie.split(';').filter(filterPredicate).length) {
    document.cookie = 'firstVisit=false';
    document.getElementById('firstVisit').classList.add(["hidden"]);
} else {
    document.cookie = 'firstVisit=true'
}
