JavaScript by Examples was created for new users to learn about the JavaScript language by reviewing real code snippets and by asking questions. This repository is a collection of code samples containing working explanations.
Currently, the code snippets are not in any particular order. Here are the concepts, language features and behavior we are planning to include:
- Functions
- Objects and Arrays
- Scopes and Closures
- Prototype inheritance
- Bind, Call, Apply and this variable
- Functional programming concepts
- Promises and async programming
- Iterators and Generators
- ES6 specific features
- Coersion
- Common Patterns
The best way to understand a language is to view actual code, form discussions, brainstorm and educate each other. JavaScript by Examples is not a replacement for conventional learning (e.g., reading books, blogs, and self-experimentation) — rather, it should be viewed as a suppliment to exisiting learning paths.
The idea for JavaScript by Examples came from a series of group chats within our team at work. We thought it might be helpful to the community as well.
It is likely that similar code snippets exist, but what makes this repository unique is the 'question/answer' format, and how we have clarified our examples with explanations. The code examples should have appropriate attributions wherever applicable. We appreciate attibution if you are using our code examples within your work.
If you believe any information here is erroneous, please report it as an issue or create a pull request. We welcome suggestions, feedback and new content, as long as it follows the format that we are using. You can also star this repo if you like the content. :)
Most code samples are either in .md
or .js
files. The markdown file format follows the 'question/answer/explanation' format. We will include useful references, links or attributions.
We would like this repository to grow and be the premeire repository for JavaScript enthusiasts. To achieve this goal, we need all the help we can from the community and people like you.
List of initial contributors.
Contributions on the GitHub Repo can be looked at here.
- Organize the items by categories and provide the links/index them.
- Include jsfiddle links for the code samples
- Include samples explaining ES6 features.
This project exists thanks to all the people who contribute. [Contribute].
Become a financial contributor and help us sustain our community. [Contribute]
Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]
The content of this project itself is licensed under the Creative Commons Attribution 3.0 license and the underlying source code used to format and display that content is licensed under the MIT license.