Complete the code to print 'Hello, Node.js!' to the console.
console.[1]('Hello, Node.js!');
The console.log function prints messages to the console in Node.js.
Complete the command to run a JavaScript file named 'app.js' using Node.js.
node [1]To run a JavaScript file with Node.js, you type node followed by the file name, here app.js.
Fix the error in the code to correctly import the 'fs' module in Node.js.
const fs = require([1]);The correct module name to import the file system module is 'fs'.
Fill both blanks to create a simple HTTP server using Node.js.
const http = require('http'); const server = http.[1]((req, res) => { res.[2]('Hello World'); });
The createServer method creates the server, and res.write sends the response body.
Fill all three blanks to start the server listening on port 3000 and log a message.
server.[1](3000, () => { console.[2]('Server is running on port ' + [3]); });
The listen method starts the server on a port, console.log prints the message, and 3000 is the port number.