conscious-sapphire
conscious-sapphire13mo ago

Using return and Actor.exit()

I wrote a function that needs to return it's result and will like to find out how to do that since I also have to call exit which terminates the function.
await Actor.init();
function funWithReturnStatement() {
// do some stuff
return data;
await Actor.exit()
}
await Actor.init();
function funWithReturnStatement() {
// do some stuff
return data;
await Actor.exit()
}
2 Replies
plain-purple
plain-purple13mo ago
Hello, what do you intend to return the data to? If you have a return on the top level, it do you want to return an exit code for the process, or what is the purpose of it?

Did you find this page helpful?