0
JavaScript in a separeate file glitch?
I'm using Brackets for my JavaScript course and when I create separate .js file with alert("Hello, World!"); , include it in the main .html file I get this error: 'alert' was used before it was defined. What am I doing wrong?
1 Answer
- 1
Try this in first line
var alert;
And after that
alert('something');