1. I have the following code in a js file:
var test = {
test1(e){
console.log(e)
}
}
2. Introduce this js, into html and call it as follows:
<script src="js/base.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
test.test1()
</script>
my goal is to output the contents of e in the console, but the console only outputs undefined
3. If you write directly to html, e has output, as shown in the following figure:
<script type="text/javascript">
window.onload = function(e){
console.log(e)
}
</script>
but not from external references, solve.