Loading

T8 Node.js · Lesson 4

Games: Files

Choose the right option, fill in the blanks, write small pieces of code and fix broken ones. Code runs in a safe box inside this page.

Solved 0 of 48 items in this lesson.

1 / 23

This runs in the shop's folder, where readings.txt holds three lines: boiler 95, pump 40 and press 70. What does it print?

cat > app.js <<'END'
const fs = require("fs");
console.log(fs.readFileSync("readings.txt", "utf8").split("\n")[1]);
END
node app.js

Back to the lesson