Template:Nasal Constructor inline: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 2: Line 2:
   new: func( {{{2|arg...}}} ) {
   new: func( {{{2|arg...}}} ) {
   # creates a temporary object that inherits from {{{1|myClass}}}
   # creates a temporary object that inherits from {{{1|myClass}}}
   var obj = { {{Nasal Inherit from|{{{1|myClass}}} }} };
   var {{{4|obj}}} = { {{Nasal Inherit from|{{{1|myClass}}} }} };
   
   
   # do any other set up here, such as for example
   # do any other set up here, such as for example
   obj.message = "Hello World";
   {{{4|obj}}}.message = "Hello World";
    
    
   {{{3|print("Creating new object"); }}}   
   {{{3|print("Creating new object"); }}}   
   
   
   # return the object to the caller
   # return the object to the caller
   return obj;
   return {{{4|obj}}};
   },
   },

Navigation menu