js_typeof: Get the type of a JavaScript object

View source: R/js_typeof.R

js_typeofR Documentation

Get the type of a JavaScript object

Description

JavaScript wrapper to typeof to test if a piece of JavaScript code is syntactically valid, and the type of object it evaluates to. Useful to verify that a piece of JavaScript code contains a proper function/object.

Usage

js_typeof(text)

Arguments

text

JavaScript code

Examples

js_typeof("function(x){return x+1}")
js_typeof("(function() {return 'foo'})()")
js_typeof("{foo : 123, bar : true}")

js documentation built on Oct. 4, 2024, 5:09 p.m.