Builtin Function: append
The built-in function append
appends a value to the end of a list. The list
is modified in-place. The return value will always be undefined.
append
called on any value other than a list or undefined will result
in an immediate error.
Examples:
Why does this function return undefined?
This function returns undefined
to avoid unintended side effects of the function in the context
of a rule.
For example, if append
returned the list value as a result, the following policy would depend
on the order in which rules are referenced:
This sort of side effect behavior introduces complex and difficult to track logical errors in programs.
As a result, functions like this return undefined
and modify values in-place.