JS Declaration or statement expected error

function checkFontStatus() {
    if (document.getElementById('serif').checked == true) {
        fontsSelected[0] = true;
    } else {
        fontsSelected[0] = false;
    }
    if (document.getElementById('sans-serif').checked == true) {
        fontsSelected[1] = true;
    } else {
        fontsSelected[1] = false;
    }
}

The console is returning the following error: ‘js declaration or statement expected’. What is the error in my code which is returning this?

AFAICT this would actually throw a reference error… is fontsSelected declared and initialised as an array?

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.