JavaScript
Goal
Write a JavaScript block as an ES module. Time: 5 minutes. Needs: Node.js.
Things to know
- The runner writes your code to
snippet.mjs, so it’s an ES module: useimport, notrequire. Top-levelawaitworks. - For Code file,
.jsand.mjsare inferred as JavaScript. - Node built-ins (
node:fs,node:path, andfetch) are available.npmpackages aren’t installed for you. - Never use
JSON.stringify(obj, null, 2)for the final line, because it prints several lines.
Check your run
Execute step prints {"message":"Hello from curl"}.
Exercise
Publish chars: an array of the unique characters in the text, sorted.