c # – Return function value in webgl unit and javascript communication

I use Unity webgl for my project and I want to communicate from browser JavaScript to C #. One method is to call the C # function from JavaScript using SendMessage. I easily make a call with the help of this code snippet:

gameInstance.SendMessage ("MyObjectName", "MyFunctionName", myParameter);

But there is a problem, it does not return any value. To get a value, I need to implement a separate function that performs another function. Can I return value directly? Send Message documents clearly indicate that they return no value. Therefore, besides sendMessage, is there a way to retrieve a return value directly from a function call?