On 17 November 2014 11:29, Alex Kocharin <[email protected]> wrote:
>
> If you do the same stuff after each function, some functional programming
> could help:
>
> function someValidationProcess() {
>   ;[doStuff, doAnotherStuff, doYetAnotherStuff, doMoreStuff]
>     .forEach(function(fn) {
>       fn()
>       doCleanUp_1()
>       doCleanUp_2()
>     })
> }
>
> In this case doStuff would have to set a flag instead of condition_1()
> probably.

Just want to add, usually in corporate world a .Net or Java developer
is who code JavaScript. The code above may be little complex for them.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to