Skip to main content

2. Language basics

This chapter covers how to write tokens, represent values, bind variables and evaluate expressions.

var price = 20;
var quantity = 3;
var total = price * quantity;
return {"total": total, "discounted": total >= 50};

The result is {"total":60,"discounted":true}. Variables hold values, expressions calculate values, and objects organize output fields.