js_eval: Evaluate JavaScript

Description Usage Arguments Examples

View source: R/js_eval.R

Description

Evaluate a piece of JavaScript code in a disposable context.

Usage

1

Arguments

text

JavaScript code

Examples

1
2
3
4
5
6
7
# Stateless evaluation
js_eval("(function() {return 'foo'})()")

# Use V8 for stateful evaluation
ct <- V8::new_context()
ct$eval("var foo = 123")
ct$get("foo")

jeroen/js documentation built on June 9, 2020, 8:03 p.m.