The ko.utils reference
The ko.utils
namespace is Knockout's bucket for utility functions. Not all of these functions are publicly exposed—at least not in a usable way. Knockout's minification process obfuscates more than half of them. As the unobfuscated methods are a public API that Knockout has committed to providing, changing them would be a major change. Despite considering all of the exposed methods on the ko.utils
part of the API, Knockout does not provide any documentation for them.
Here is a complete list of the public functions on ko.utils
as of Knockout 3.2:
addOrRemoveItem(array, item, included)
: Ifincluded
istrue
, it will add the item to the array if it is not already there; ifincluded
isfalse
, it will remove the item from the array if it is present.arrayFilter(array, predicate)
: This returns an array of elements from the array that returnstrue
from the predicate usingpredicate(element, index)
.arrayFirst(array, predicate, predicateOwner)
: This returns the first element...