You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two new functions should be handy in many scenarios: where and reduce. The latter is a nice addition to map, which transforms elements (providing a mapping from the source to the target). It will reduce the N elements to a single item.
The where function is essentially filter in JS (or Where in LINQ).
reduce will work with matrices and objects. It requires three arguments: a function, a start value, and an object to operate on.
Remark In v0.9 I will change greater, less, etc. to be actually like greater(x, y) == y > x. Right now (v0.8) it is greater(x, y) == x > y. There are some other functions that need to be reversed to be better for chaining, e.g., subtract, pow, or divide.
The text was updated successfully, but these errors were encountered:
Two new functions should be handy in many scenarios:
where
andreduce
. The latter is a nice addition tomap
, which transforms elements (providing a mapping from the source to the target). It will reduce the N elements to a single item.The
where
function is essentiallyfilter
in JS (orWhere
in LINQ).reduce
will work with matrices and objects. It requires three arguments: a function, a start value, and an object to operate on.where
will work with matrices and objects. It requires two arguments: a function and an object to operate on.Remark In v0.9 I will change
greater
,less
, etc. to be actually likegreater(x, y) == y > x
. Right now (v0.8) it isgreater(x, y) == x > y
. There are some other functions that need to be reversed to be better for chaining, e.g.,subtract
,pow
, ordivide
.The text was updated successfully, but these errors were encountered: