Learn R Programming

QuickJSR (version 1.6.0)

JSContext-method-call: 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, ...)

Value

The result of calling the specified function

Format

An object of class NULL of length 0.

Arguments

function_name

The function to be called

...

The arguments to be passed to the function

Examples

Run this code
if (FALSE) {
ctx <- JSContext$new()
ctx$source(code = "function add(a, b) { return a + b; }")
ctx$call("add", 1, 2)
}

Run the code above in your browser using DataLab