js_eval {js} | R Documentation |
Evaluate JavaScript
Description
Evaluate a piece of JavaScript code in a disposable context.
Usage
js_eval(text)
Arguments
text |
JavaScript code |
Examples
# Stateless evaluation
js_eval("(function() {return 'foo'})()")
# Use V8 for stateful evaluation
ct <- V8::new_context()
ct$eval("var foo = 123")
ct$get("foo")
[Package js version 1.2 Index]