Scripting reference · Nerdamer Language

block

Evaluates expressions in order and returns the last value.

Use it to run several steps inside one expression, such as a function body or a loop body.

Scripting

block(first, second, ..., last)

Write it in a script: nerdamer('block(x:2,y:3,x+y)'), or in the Playground.

Parameters

first, second, ...
Expressions evaluated in order.
last
The expression whose value is returned.

Examples

Assign two values, then use them.

block(x:2,y:3,x+y)
// → 5
Open in Playground

return ends the block early.

block(return(7),9)
// → 7
Open in Playground

← Back to Nerdamer Scripting