-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.txt
More file actions
36 lines (26 loc) · 1021 Bytes
/
Copy pathREADME.txt
File metadata and controls
36 lines (26 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
JavaScript Examples
-------------------
This archive contains small JavaScript example files for each topic:
array_methods, arrow_functions, classes, destructuring, modules, spread_ops, ternary_ops, variables
Each subfolder contains an example file:
- classes/index.js
- arrow_functions/index.js
- variables/index.js
- array_methods/index.js
- destructuring/index.js
- modules/export.js and modules/main.js
- ternary_ops/index.js
- spread_ops/index.js
You can inspect or run these files with Node.js.
This workspace includes a package.json with "type": "module" so ES modules (import/export) work out of the box.
How to run examples from the command line:
- Run the ES module example that logs to the console:
node modules/main.js
- Or use the npm script:
npm start
How to serve the examples over HTTP on localhost:
- Start the simple static server included here (serves the current folder):
node serve.js
- Or with npm script:
npm run serve
Then open http://localhost:3000 in your browser to browse files.