Learn R Programming

QuickJSR (version 1.5.1)

JSContext-method-assign: Assign a value to a variable in the current context

Description

Assign a value to a variable in the current context

Usage

assign(var_name, value)

Value

No return value, called for side effects

Format

An object of class NULL of length 0.

Arguments

var_name

The name of the variable to assign

value

The value to assign to the variable

Examples

Run this code
if (FALSE) {
ctx <- JSContext$new()
ctx$assign("a", 1)
ctx$get("a")
}

Run the code above in your browser using DataLab