I am studying ES2015 export function. I tried to figure it out online, but my doubts are still unresolved.
When I declare an export inside an anonymous function, jshint shows the following error (at least inside the Intellij plugin):
E053 Export declaration must be in global scope.
In contrast, JSHint always requests the full code inside the Anonymous function. If I write the code as follows:
export const MY_CONSTANT = 1000; (function(){ 'use strict';
We have to write a lot of code at the top and bottom of the page. Some code will go from the file to the beginning (or end) of the page.
source share