Why is the semi-colon required after the string toInsert
for the forEach
to work?
const toInsert = "";
['Heading Font','Body Font'].forEach(f=>{
console.log(f)
})
If I remove the semi-colon, it gives me an error Uncaught TypeError: Cannot read property 'forEach' of undefined
I thought semicolons were not required in JS?