Console.log (e) output undefined

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>

clipboard.png

but not from external references, solve.

Mar.22,2021

change to window.onload = test.test1


you must inject events to have e, such as onload,click and other events


sibling event objects must have events

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3e415-2c3f6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3e415-2c3f6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?