Recall & Review
beginner
What is Node.js?
Node.js is a program that lets you run JavaScript code outside a web browser, usually on your computer or server.
Click to reveal answer
beginner
How do you run a JavaScript file named
app.js using Node.js?Open your terminal or command prompt and type
node app.js, then press Enter.Click to reveal answer
beginner
What does the command
node do when used alone in the terminal?It opens an interactive JavaScript shell where you can type and run JavaScript commands one by one.
Click to reveal answer
beginner
Why might you want to use Node.js instead of running JavaScript in a browser?
Node.js lets you run JavaScript on your computer or server to build apps, work with files, or create servers, which browsers can't do alone.
Click to reveal answer
beginner
What is the first step to run JavaScript with Node.js after installing it?
Open your terminal or command prompt, navigate to the folder with your JavaScript file, then run
node filename.js.Click to reveal answer
Which command runs a JavaScript file named
script.js using Node.js?✗ Incorrect
The correct command to run a JavaScript file with Node.js is
node filename.js.What does Node.js allow you to do?
✗ Incorrect
Node.js lets you run JavaScript code outside the browser, on your computer or server.
What happens if you type
node alone in the terminal?✗ Incorrect
Typing
node alone opens a REPL (Read-Eval-Print Loop) where you can type JavaScript commands interactively.Before running a JavaScript file with Node.js, what should you do?
✗ Incorrect
You need to open your terminal and navigate to the folder where your JavaScript file is saved before running it.
Which of these is NOT a use case for Node.js?
✗ Incorrect
Node.js does not style web pages; CSS is used for styling in browsers.
Explain how to run a JavaScript file using Node.js from start to finish.
Think about what you do in the terminal step by step.
You got /4 concepts.
Describe what Node.js is and why it is useful.
Imagine explaining Node.js to a friend who only knows JavaScript runs in browsers.
You got /4 concepts.