¶fluent-array are methods that extend the Javascript’s Array object@.add (value…)adds a value to the current arrayArray::add = (value…)-> for item in value @.push(item) @
¶@.contains (value)returns true if the current array has valueSuports the case when value is a an Array, where all provided elements of the value array are expected to exists in @Array::contains = (value)-> if value instanceof Array for item in value if not (item in @) return false return true; else (value in @)
¶@.item (index)Returns item[index] if array has that itemNote: Double check behaviour of Array.length and check for possible edge casesArray::item = (index)-> if typeof(index) is ‘number’ if @.length > index > -1 return @[index] null
¶@.remove_If_ContainsRemoves an element from an array if it contains a particular string Note that all elements (and match) will be converted into strings before comparisonArray::remove_If_Contains = (value)-> return @ if not value @.filter (word) -> word.str().not_Contains(value.str())