Prism · Core

$var

Reads a name bound further up: by $with, or by the as of $map, $filter and the other operators that go through a list. A name that is not in scope refuses with E_VAR_NOT_FOUND.

The source
{ price: 40, rate: 0.2 }
The config
{
  $with: {
    let: {
      tax: { $mul: [{ $ref: '$.price' }, { $ref: '$.rate' }] },
    },
    value: { $var: 'tax' },
  },
}
What comes out
8
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.