FCF 2.0 development in progress...
> > > >
[News] [Packages API] [Downloads] [Donate to the project] [Contacts]

fcf.inlineExecution() function

mixed fcf.inlineExecution(string a_code)
mixed fcf.inlineExecution(string a_code, object a_environment)

Package: fcf-framework-core

File: fcf-framework-core:fcf.js

Available from version: 2.0.2

Evaluates a single line Javascript expression

On the NODEJS server side, the passed Javascript command is executed by the interpreter, which ensures the safe execution of the passed command, which can be passed from an arbitrary source. On the browser side, the eval function is used for execution.

A more detailed description of the execution of secure inline instructions can be found on the tokenization description page: Tokenization

Arguments

string a_code
- A string containing a single line Javascript instruction

object a_environment
- An object containing the values of variables passed to the executable command
Result
mixed
- Calculation result

Example: Function application

let result = fcf.inlineExecution("arg1 ? 'Yes' : 'No'", {arg1: true}) console.log(result);

Output:

Yes