Question:
What is this error message SyntaxError: Unexpected token 'else' (at yourPlayground.js:36:1)
. I copied code exactly as the tutorial showed me. Although, I am getting this error message when the video guy doesn’t.
JavaScript Tutorial for Beginners - Full Course in 12 Hours (2022) - YouTube Watch 38:30 into the video.
The following is code that I am trying to run. Why do I get syntax error after hitting the run button?
let weather = 'sunny'
if (weather == 'rain') {
console.log('grab your umbrella')
else{
console.log('wear your sunglasses')
}