×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Added: Apr 22, 2014 4:01 PM
Modified: Apr 22, 2014 4:05 PM
Views: 12
Tags: jclass
Estructura basica de una clase orientada a objetos javascript
  1. var MyClass = (function () {
  2.     function MyClass(message) {
  3.         this.greeting = message;
  4.     }
  5.     MyClass.prototype.greet = function () {
  6.         return "Hello, " + this.greeting;
  7.     };
  8.     return MyClass;
  9. })();
  10.  
  11. var myclass = new MyClass("world");