Why does this throw the error and what is the correct way of calling an outer (global scope) function from within a module class?
//models.js
export default class Model {
log() {
gLog(); //Uncaught ReferenceError: gLog is not defined
}
}
//main.js
import Model from './models.js';
let m = new Model();
m.log();
function gLog() {
console.log(1);
}