1 KiB
1 KiB
Changelog
[2.0.0] - 2019-09-07
Added
- Better support for arrays, including literals:
[ 1, 2, 3 ]
and indexing:array[0]
- New functions for arrays:
join
,indexOf
,map
,filter
, andfold
- Variable assignment:
x = 4
- Custom function definitions:
myfunction(x, y) = x * y
- Evaluate multiple expressions by separating them with
;
- New operators:
log2
(base-2 logarithm),cbrt
(cube root),expm1
(e^x - 1
),log1p
(log(1 + x)
),sign
(essentiallyx == 0 ? 0 : x / abs x
)
Changed
min
andmax
functions accept either a parameter list or a single array argumentin
operator is enabled by default. It can be disabled by passing { operators:{ 'in': false } }
to theParser
constructor.||
(concatenation operator) now supports strings and arrays
Removed
- Removed the
if(condition, trueValue, falseValue)
function. Use the ternary conditional operator instead:condition ? trueValue : falseValue
, or you can add it back easily with a custom function.