Posted By

sveggiani on 08/13/10


Tagged


Versions (?)

example of a javascript namespace with public and private methods and functions


 / Published in: JavaScript
 

  1. // testing namespace
  2. var crewrApp = new function() {
  3.  
  4. var internalFunction = function() {
  5. console.log('soy una función interna');
  6. };
  7.  
  8. this.publicFunction = function() {
  9. console.log('soy una función pública');
  10. };
  11.  
  12. var test1 = 'testing 1';
  13. this.test2 = 'testing 2';
  14.  
  15. };

Report this snippet  

You need to login to post a comment.