Project

General

Profile

Snippet

Description

Executes custom Javascript code

Input/Output

Input : any <= Source
Snippet : value (text) <= User

Output : any

Usage

  1. Connect one or more sources to the operator
  2. Type Javascript code inside the editor. Each source is labeled as s1, s2 and so on so you can use them in your code. Remember to type a " return something " statement at the end of your code
  3. Click on OK

Example

Input = ["value":1, "value":2, "value":3]
Snippet = "var sum = 0; for(var i = 0; i < s1.length; i++) sum += s1[i].value; return sum;"

Output = 6