How can ordinary, top level functions, that are part of the default closure be exposed to the JS console in the browser (for debugging reasons)?
// default.js
function iWantToCallThisFunction() {
console.log("test successfull");
}
There's this answer from 2014, which doesn't seem to be valid anymore: https://stackoverflow.com/a/9054881/6204346
At least a current Chrome can't find the function and defaults to undefined
.
Flagging the function with export
doesn't seem to make a difference. It would probably be possible but inconvenient to safe the function in the window
. Is there a better way?