In JS FP do u ever extend objs with other objs? tweet
Yes, frequently to copy data from one collection to another during object creation, but once created and returned, objs are treated as immutable collections. Contrast against shared state with methods that mutate properties as in OOP. As a consequence of the immutable nature of collections in FP, pure functions boast stronger encapsulation features than private methods in OOP, because they guarantee against side-effects.
Unlike in OOP, most functions in FP are generic and independent of object properties and collection element contents, so there is typically no need to copy methods from object to object.
One major exception is that collections (or observable streams in FRP) may be enhanced with a number of functional utility methods which all return new values rather than mutating the properties of the parent object.