Here I have Person class in a separate file then exporting it to my main script:
export default class Person {
constructor(name) {
this.name = name;
}
}
and in my script i import it then instantiate an object(woman) from:
<script type="module">
import Person from './Person.js'
const woman = new Person('alica')
</script>
and this is console's error when i try to access woman object:
Uncaught ReferenceError: woman is not defined
isn't woman a global object?
Edit: I mean access through browser's console