JS: Mark character strings as literal JavaScript code

View source: R/JS.R

JSR Documentation

Mark character strings as literal JavaScript code

Description

This function JS() marks character vectors with a special class, so that it will be treated as literal JavaScript code. It was copied from the htmlwidgets package, and does exactly the same thing.

Usage

JS(...)

Arguments

...

character vectors as the JavaScript source code (all arguments will be pasted into one character string)

Author(s)

Yihui Xie

Examples

ct <- v8()
ct$eval("1+1")
ct$eval(JS("1+1"))
ct$assign("test", JS("2+3"))
ct$get("test")

jeroenooms/V8 documentation built on Feb. 17, 2024, 5:25 a.m.