Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mdn/js-examples
Code examples that accompany the MDN JavaScript/ECMAScript documentation
https://github.com/mdn/js-examples
ecmascript examples javascript
Last synced: 7 days ago
JSON representation
Code examples that accompany the MDN JavaScript/ECMAScript documentation
- Host: GitHub
- URL: https://github.com/mdn/js-examples
- Owner: mdn
- License: cc0-1.0
- Created: 2017-01-19T23:53:45.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2024-07-09T10:15:10.000Z (5 months ago)
- Last Synced: 2024-11-28T11:04:15.681Z (14 days ago)
- Topics: ecmascript, examples, javascript
- Language: JavaScript
- Homepage: https://developer.mozilla.org/en-US/docs/Web/JavaScript
- Size: 556 KB
- Stars: 1,144
- Watchers: 35
- Forks: 706
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-github-star - js-examples
- jimsghstars - mdn/js-examples - Code examples that accompany the MDN JavaScript/ECMAScript documentation (JavaScript)
README
# js-examples
This repository contains examples of JavaScript usage.
The "promises-test" directory contains a JS promises test example, for learning purposes. [Run the example live](http://mdn.github.io/js-examples/promises-test/).
The "modules" directory contains a series of examples that explain how [JavaScript modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) are used. The subdirectories are as follows:
- [basic-modules](module-examples/basic-modules): Simple example that demonstrates module basics, including default exports ([run the example live](http://mdn.github.io/js-examples/module-examples/basic-modules)).
- [renaming](module-examples/renaming): Shows how exports can be renamed to avoid conflicts, using `x as y` syntax ([run the example live](http://mdn.github.io/js-examples/module-examples/renaming)).
- [module-objects](module-examples/module-objects)): Shows how to import an entire module as an object using `import * as x from 'y.js'` syntax ([run the example live](http://mdn.github.io/js-examples/module-examples/module-objects)).
- [classes](module-examples/classes): Provides an example of importing a class from a module ([run the example live](http://mdn.github.io/js-examples/module-examples/classes)).
- [module-aggregation](module-examples/module-aggregation): Shows how sub module features can be aggregated into a parent module using `export { x } from 'y.js'` syntax ([run the example live](http://mdn.github.io/js-examples/module-examples/module-aggregation)).
- [dynamic-module-imports](module-examples/dynamic-module-imports): Demonstrates dynamic module loading using `import().then()` ([run the example live](http://mdn.github.io/js-examples/module-examples/dynamic-module-imports)).
- [top-level-await](module-examples/top-level-await): An example of using the `await` keyword within a module ([run the example live](http://mdn.github.io/js-examples/module-examples/top-level-await)).