>>10879645function sad (){
return (() => {
function stop() {
//Do something to stop being sad
}
return true;
})();
}
I think it would work in javascript.
Function sad returns an anonymous function containing a stop function which runs automatically and when it runs it returns true. Haven't tried it though, no way im debugging this.