When a function is passed as an argument, do we get a reference to it or a copy of the function itself?

  • 0
    let foo = function (callback) {
      callback();
      document.write(callback);
      if (callback === bar) {
        document.write("Callback equal bar because callback it is bar");
      } 
    };
    
    let bar = function () {
    };
    
    foo(bar);


    Advise materials on FP, if it's not difficult) it is desirable to explain what conveyors, composition and all these things are ...
    JavaScript Hannah Mays, Aug 13, 2019

  • 1 Answers
  • 0
    link,



    Earlier on Hexelet a course on programming in js used a functional approach, you can try referring to their materials.



    This course was partially based on the SICP book, you can try to refer to it, the source code for this book uses the functional Scheme language (Structure and Interpretation of Computer Programs - Abelson, Sussman).



    not sure if pipeline and composition are directly related to php.
    Clare Strong

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!