This is a breaking change and I would wait a bit before we do this to settle the current unreleased changes.
We should rename the current find* methods to filter* because in JavaScript find methods are expected to return the single element and our implementation if the method is inconsistent. We should implement find* to return first matching item.
Take the following example:
// JS Array `find`
["a", "b", "c"].find(c => c === "b"); // "b"
// Array Element `find`
ArrayElement(["a", "b", "c"]).find(c => c.toValue() === "b"); // ["b"]
// We return array slice of B not just B.
This is a breaking change and I would wait a bit before we do this to settle the current unreleased changes.
We should rename the current
find*methods tofilter*because in JavaScriptfindmethods are expected to return the single element and our implementation if the method is inconsistent. We should implementfind*to return first matching item.Take the following example: