Removes the first occurrence of value
from the list at path
.
Returns true if value was in the list, false otherwise.
Note: Renamed from remove
because that conflicts with
HtmlElement.remove.
Source
bool removeItem(String path, value) {
List list = get(path);
var index = list.indexOf(value);
/// Assumes the lists are in sync! We are in lots of trouble if they aren't
/// though, and verifying it is a lot more expensive.
jsElement.callMethod('splice', [path, index, 1]);
return true;
}