Skip to content

Tag: closures

Is it good pratice to add closure inside constructor?

I have added closure inside the constructor and unsure of its performance as well as best practice. What is the best way to do that if it is not the right way to do it? Answer I have an own array class with a lot of functions (or closures) defined in the constructor. This type of definition of functions also