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?

21st Jul 2019, 8:50 PM
da_dev
1 Réponse
- 1
Try this in first line var alert; And after that alert('something');
21st Jul 2019, 11:50 PM
Yazan Alnughnugh
Yazan Alnughnugh - avatar