JSContext-method-call {QuickJSR} | R Documentation |
Call a JS function in the current context
Description
Call a specified function in the JavaScript context with the provided arguments.
Usage
call(function_name, ...)
Arguments
function_name |
The function to be called |
... |
The arguments to be passed to the function |
Format
An object of class NULL
of length 0.
Value
The result of calling the specified function
Examples
## Not run:
ctx <- JSContext$new()
ctx$source(code = "function add(a, b) { return a + b; }")
ctx$call("add", 1, 2)
## End(Not run)
[Package QuickJSR version 1.3.1 Index]