I am curious as to why I do not have access to defined variables in the browser console when I have my script type set to type="module"
.
Below is a hypothetical set up:
<!DOCTYPE html>
<html>
<head>
<div id="containerFirst">...</div>
<div id="differentContainer">...</div>
</head>
<body>
...
</body>
<script type="module" src="module.js"></script>
<script src="normal.js"></script>
</html>
And here are the two JS files, first module.js:
export const firstContainer = document.getElementById('containerFirst');
and similar variable structure in normal.js:
const otherContainer = document.getElementById('differentContainer');
When I run this in a browser, I can access the variable defined in normal.js by typing it directly into the console but not the one from module.js. I'm hoping to find some clarity on this matter. Thanks!