Could someone explain me what this mean line by line, please, Thanks anyone who will try to help: : 1. This is code.js from my tutorial
2. I need help with my homework:

    var buttonRef2 = document.getElementById('toggle');
    buttonRef2.onclick = function () {
    var state = document.getElementById('wikiList').style.display;
    var txt = document.getElementById('toggle').textContent;
    if(state == 'none' && txt == 'show' ) {
        document.getElementById('wikiList').style.display = 'block';
        document.getElementById('toggle').textContent = 'hide';
        document.getElementById('toggle').classList.add('extraStyle');
    }else{
        document.getElementById('wikiList').style.display = 'none';
        document.getElementById('toggle').textContent = 'show';
        }
     }