javascript-patterns icon indicating copy to clipboard operation
javascript-patterns copied to clipboard

JavaScript Design Patterns

Results 21 javascript-patterns issues
Sort by recently updated
recently updated
newest added

https://github.com/shichuan/javascript-patterns/issues/101 https://developers.google.com/speed/articles/optimizing-javascript http://jsperf.com/concat-vs-plus-vs-join https://stackoverflow.com/questions/112158/javascript-string-concatenation

On https://github.com/shichuan/javascript-patterns/blob/master/jquery-patterns/append.html there's a slight consistency error with your other patterns. It is recomended to use array.push() and then join it instead of appending string over and over So, instead...

On my tablet and phone the website looks similar to this: ![selection_153](https://f.cloud.github.com/assets/285352/2366262/ed565ff0-a6f8-11e3-9cef-026dd9580cfd.png)

[Here](https://github.com/shichuan/javascript-patterns/blob/master/general-patterns/function-declarations.html) you mention that function declarations are an anti-pattern. However you don't substantiate this. Do you say this because FunctionDeclaration hoisting is sometimes considered confusing? I don't believe Function Declarations...

In explanations for certain patterns, other anti-patterns are often used. I.E. in the explanation code for the "Single var pattern", the patterns for "Function Declarations" and "Access to the Global...

This happens if the browser window isn't wide enough. See attached image. ![JavaScript_Patterns](https://f.cloud.github.com/assets/318190/271409/3fb9e0dc-8fe4-11e2-90b7-0a23bedaba3a.png)

switch pattern `case` statements are indented. expect to be aligned with `switch` declaration. ``` * 1. Aligning each `case` with `switch` ``` ... ``` switch (inspect_me) { case 0: result...

I've come up with a really good convention for naming methods: ``` javascript person.getData = function person_getData() { }; ``` We prepend with `person_` so that the function name is...

// named function expression /\* Benefits: \* 1. Provides the debugger with an explicit function name: helps stack inspection. \* 2. Allows recursive functions: getData can call itself. \* Issues:...

Due to name issue, the link is 404 for now. The available link should be [https://chuanxshi.github.io/javascript-patterns/](https://chuanxshi.github.io/javascript-patterns/) rather than [https://shichuan.github.io/javascript-patterns/](https://shichuan.github.io/javascript-patterns/) before: after: