Learn R Programming

QuickJSR (version 1.7.0)

qjs_eval: qjs_eval

Description

Evaluate a single Javascript expression.

Usage

qjs_eval(eval_string)

Value

The result of the provided expression

Arguments

eval_string

A single string of the expression to evaluate

Examples

Run this code
# Return the sum of two numbers:
qjs_eval("1 + 2")

# Concatenate strings:
qjs_eval("'1' + '2'")

# Create lists from objects:
qjs_eval("var t = {'a' : 1, 'b' : 2}; t")

Run the code above in your browser using DataLab