https://github.com/fixjs/patterns.js
Explore JavaScript's best practices and coding style guides.
https://github.com/fixjs/patterns.js
Last synced: 5 months ago
JSON representation
Explore JavaScript's best practices and coding style guides.
- Host: GitHub
- URL: https://github.com/fixjs/patterns.js
- Owner: fixjs
- License: mit
- Created: 2014-12-02T09:15:35.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-12T20:53:55.000Z (over 11 years ago)
- Last Synced: 2023-08-27T00:34:04.700Z (almost 3 years ago)
- Language: JavaScript
- Size: 523 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#PatternsJS
It's not an application or a JavaScript library, it is here to showcase the JavaScript's best practices and coding style guides.
As JavaScript developers we have always had whole bunch of repetitive tasks and patterns to deal with and I thought why not gathering all together and put them forward to the JavaScript community.
The initial point which made me set up this repo, was a simple known pattern:
##JavaScript Method Overloading
I have faced with this very question several times and in practice, I have answered it in couple of different ways. Before walking through the possible patterns, let's start with this code snippet:
```
/*
* getData(url)
* getData(url, callback)
* getData(params) params:{ url: '', callback: function(){}, ... }
*/
function getData(){
//...
}
```
[Read more about this pattern.](https://github.com/fixjs/patterns.js/tree/master/patterns/method-overloading)