Skip to content

Advantage of using apply #1

@tw00

Description

@tw00

Hi,
this little library turned out very helpful for a project I'm working on. One thing though is not 100% clear to me. Is there any reason to use Function.apply over just calling a and b directly?

Currently I'm using this adaption of the function:

function joint( a ) {
  var b = a[(a.length - 1)];
  a.pop();

  a = a.length > 1 ? joint( a ) : a[0];

  return function(...args) {
    return b( a(...args) )
  };
}

It also also allows to pass arguments through the joint functions.

Cheers, Thomas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions