Guest User

Untitled

a guest
Aug 7th, 2025
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.44 KB | Source Code | 0 0
  1. var MyClass = (function () {
  2.  
  3.     // ctor
  4.     function MyClass() {
  5.         /**  @type {string}  */
  6.         this.value = "";
  7.     }
  8.  
  9.  
  10.     MyClass.prototype = {
  11.  
  12.         /** @returns {number} */
  13.         getValue: function () {
  14.             this.value = "hello, world!";
  15.             return 26;
  16.         },
  17.  
  18.     };
  19.  
  20.     return MyClass;
  21. })();
  22.  
  23. var myClass = new MyClass();
  24. var result = myClass.getValue();
  25. console.log(result);
Advertisement
Add Comment
Please, Sign In to add comment