Learn R Programming

QuickJSR (version 1.5.1)

JSContext-method-get: Get a variable from the current context

Description

Get the value of a variable from the current context

Usage

get(var_name)

Value

The value of the variable

Format

An object of class NULL of length 0.

Arguments

var_name

The name of the variable to retrieve

Examples

Run this code
if (FALSE) {
ctx <- JSContext$new()
ctx$source(code = "var a = 1;")
ctx$get("a")
}

Run the code above in your browser using DataLab