The spread operator (...) makes it easier to build arrays, objects, and call functions where the list of arguments is built at runtime. For instance, while using in an array literal, the value on the right of the operator is inserted into the new array at that position. Similarly, in a function call, the array expands and is used as the arguments to the function. In an object literal, the right side of the operator is another object that has its keys added to the new object.
To build a new array that is made up of another array surrounded by two elements:
If you want to find the maximum value in an array of numbers:
To create a new object with some fixed values and entries in the "$extra" object:
You can add notes to your expressions using comments. A comment starts with '/*' and ends with '*/', for example:
The comment will be ignored when evaluating the expression, it is only for the reader's benefit.
* / %
< <= > >=
Creating variables and assigning values is not supported