Commits

Kumar McMillan committed 44209d1

Better JavaScript code example

Comments (0)

Files changed (1)

docs/javascript.rst

     
     // if you had e.g. a session object that looked something like:
     yourapp = {};
-    yourapp.Session = function() {
-        // ...
-    };
-    yourapp.Session.prototype.set = function(key, value) {
-        // ...
-    };
-    yourapp.session = new yourapp.Session();
+    yourapp.session = {
+        set: function(key, value) {
+            // ...
+        }
+    }
     yourapp.startup = function() {
         yourapp.session.set('saw_landing_page',true);
     };