Skip to main content

semicolon insertion puzzlement in front of [] [duplicate]

Why did I need a semicolon at }) right before [inTitle line ? I spend whole bunch of time troubleshooting this and saw that the reason it wasn't working because I omitted semicolon. And I know now it works this way and I assume it has to do w/ what comes up next but I just cannot figure out the documentation that has this info. Can someone please point me to right direction?

 btnAddNote.addEventListener('click', () => {

         this.onNoteAdd()
    });



    [inpTitle, inpBody].forEach(inputField => {
        inputField.addEventListener("blur", () => {
            const updatedTitle = inpTitle.value.trim()
            const updatedBody = inpBody.value.trim()

            this.onNoteEdit(updatedTitle, updatedBody)
        })
    })
Via Active questions tagged javascript - Stack Overflow https://ift.tt/8u6HOro

Comments