# js-examples
This repository contains examples of JavaScript usage.
The "editable-samples" directory contains JavaScript examples that are intended to be embedded in MDN pages as live editable samples.
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)).
没有合适的资源?快使用搜索试试~ 我知道了~
MDN JavaScriptEMMAScript文档附带的代码示例 仅供学习参考用代码.zip
共98个文件
js:44个
css:29个
html:14个
需积分: 5 0 下载量 101 浏览量
2023-05-16
20:35:50
上传
评论
收藏 272KB ZIP 举报
温馨提示
js源码
资源推荐
资源详情
资源评论
收起资源包目录
MDN JavaScriptEMMAScript文档附带的代码示例 仅供学习参考用代码.zip (98个子文件)
MDN JavaScriptEMMAScript文档附带的代码示例 仅供学习参考用代码
promises-test
myLittleVader.jpg 97KB
REVIEWING.md 613B
.editorconfig 188B
editable-samples
repl
pages
array-push
array-push.js 150B
index.html 558B
js
editable.js 2KB
css
editable.css 481B
array-slice
index.html 559B
array-slice.js 145B
editor
pages
array-indexof
array-indexof.js 286B
index.html 1KB
array-find
index.html 1KB
array-find.js 258B
array-push
array-push.js 240B
index.html 1KB
array-slice
index.html 1KB
array-slice.js 263B
array-map
array-map.js 252B
index.html 1KB
js
editable.js 1KB
codemirror
lib
codemirror.min.js 231KB
codemirror.css 8KB
mode
css
javascript
CHANGELOG.md 62KB
theme
xq-dark.css 3KB
twilight.css 2KB
eclipse.css 1KB
vibrant-ink.css 2KB
erlang-dark.css 2KB
ambiance-mobile.css 103B
lesser-dark.css 3KB
elegant.css 781B
neo.css 947B
icecoder.css 2KB
ambiance.css 26KB
abcdef.css 2KB
solarized.css 5KB
monokai.css 2KB
xq-light.css 2KB
blackboard.css 2KB
tomorrow-night-bright.css 2KB
the-matrix.css 2KB
ttcn.css 2KB
liquibyte.css 4KB
night.css 2KB
colorforth.css 2KB
neat.css 688B
cobalt.css 2KB
rubyblue.css 2KB
addon
hint
show-hint.css 624B
selection
css
editable.css 891B
CONTRIBUTING.md 3KB
CODE_OF_CONDUCT.md 464B
.prettierrc.json 3B
README.md 2KB
module-examples
classes
modules
canvas.js 1KB
square.js 849B
triangle.js 1KB
circle.js 1KB
main.js 842B
index.html 292B
renaming
modules
canvas.js 660B
square.js 731B
triangle.js 996B
circle.js 903B
main.js 1KB
index.html 295B
dynamic-module-imports
modules
canvas.js 1KB
square.js 849B
triangle.js 1KB
circle.js 1KB
main.js 1KB
index.html 448B
module-objects
modules
canvas.js 660B
square.js 731B
triangle.js 996B
circle.js 903B
main.js 912B
index.html 293B
module-aggregation
modules
canvas.js 1KB
shapes
square.js 849B
triangle.js 1KB
circle.js 1KB
shapes.js 139B
main.js 764B
index.html 298B
top-level-await
data
colors.json 111B
modules
canvas.js 1KB
square.js 849B
triangle.js 1KB
circle.js 1KB
main.js 1KB
index.html 448B
package.json 21B
README.md 1KB
basic-modules
modules
canvas.js 660B
square.js 1KB
main.js 503B
index.html 292B
共 98 条
- 1
资源评论
极客11
- 粉丝: 357
- 资源: 2173
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功