Below you will find pages that utilize the taxonomy term “pattern”
Posts
private variables in javascript
Found a nice post about private variables and “methods” in javascript. Consider this example:
function Pizza() { var price = 0; this.setPrice = function(p) { price = p; }; this.getPrice = function() { return price; }; } ```Every variable and function inside the main function is private unless it is appended to "this".
Posts
javascript: Umbrella pattern
There are two great patterns for organizing javascript code: Prototype and Module pattern. More about them later in this post. But in reality I still see much of spagghetti Just an example: SharePoint 101 code samples. They are indeed very simple and isolated examples. And many projects use this simple way in mind when they begin. But when javascript code grows, it becomes a monster. Have you seen this biest? How is this monster created?