Suppose you've defined a JavaScript function like this:
Here are a few ways to execute it from the host and print out the return value:
Thanks!
engine.Execute("function myFunction(a, b, c) { return a * b + c; }");
Console.WriteLine(engine.Script.myFunction(1, 2, 3)); Console.WriteLine(engine.Script["myFunction"](4, 5, 6)); Console.WriteLine(engine.Invoke("myFunction", newobject[] { 7, 8, 9 }));