DEV Community

Discussion on: Intro to Functional Combinators in Javascript

Collapse
 
jwp profile image
John Peters • Edited

Yes no problem with that idea. As we build reusable parts, we have no choice but to use Composition as our style, which you referred to in this article. Nice...

If we use only composed functions it is no different than using composed classes. OOPers have been composing classes for 30 years now. The concepts are identical. So really. It's a matter of containment and how to implement.

AFAIK, Typescript compiles everything down to functions anyway.

Thread Thread
 
jethrolarson profile image
Jethro Larson

Depending on your compile target, yeah. However, those constructor functions create objects and v8 turns objects into hidden classes so everything is everything :)

blog.sessionstack.com/how-javascri...
See also wiki.c2.com/?ClosuresAndObjectsAre...

Thread Thread
 
jwp profile image
John Peters • Edited

I wasn't referring to V8 internals, just comparing the new Javascript Class to Functions described here:

developer.mozilla.org/en-US/docs/W...