Reputation: 173
I was using JavaScript Code in my index.html page. and then I thought to shift all my JavaScript code to .js file. so when I did all the copy-paste thing and moved all my code to .js file. I started getting error in Dreamweaver
error was: Missing "use strict" statement
and so I wrote "use strict";
on top of my .js file
now I started getting error : Use the function form of "use strict"
so I tried (function () { "use strict"; //rest of my code })();
now I have solved all the error related to "use strict";
but now I have another error : "myFunction" is defined but never used.
and to solve that I'm using /*exported myFunction*/
but that is not working can anyone guide what should I do to remove 2 error I'm getting ?
should I use "use strict";
and /*exported myFunction*/
inside each function of my code onebyone ?
Upvotes: 2
Views: 3698
Reputation: 65806
Neither of those are errors. They are warnings that Dreamweaver is alerting you to.
"use strict"
is never required, but can be a good best-practice to use in many cases because it can alert you to problems in your code that will silently fail without it.Upvotes: 3