Question from the Javascript test

Write a module in Javascript

Hard

What is the name of the pattern used in this piece of code:

var myModule = (function($, _) {

  function doSomethingPrivate() {
    // ...
  }

  return {
    publicMethod : function() {
      doSomethingPrivate();
    }
  };

})(jQuery, _);
Author: Jean-marie CléryStatus: PublishedQuestion passed 2025 times
Edit
2
Community Evaluations
developer avatar
Obsolete
Benoit
17/09/2024
question de 2010, plus personne ne code comme ça