I am trying to test simple export
and import
sample.
//file a.js
export const a = 2
//file b.js
import {a} from './a.js'
console.log(a);
But it show error
import {a} from './a.js'
^^^^^^
SyntaxError: Cannot use import statement outside a module
I use vscode to test this.
a.js and b.js is in the same folder.
I have no idea to this.