0
0
Javascriptprogramming~5 mins

Running JavaScript using Node.js - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
Ajs run script.js
Bnode script.js
Crun script.js
Dexecute script.js
What does Node.js allow you to do?
ACreate CSS styles
BOnly run JavaScript inside browsers
CWrite HTML code
DRun JavaScript outside the browser
What happens if you type node alone in the terminal?
AStarts an interactive JavaScript shell
BRuns the last JavaScript file
CShows Node.js version
DOpens a text editor
Before running a JavaScript file with Node.js, what should you do?
AOpen terminal and go to the file's folder
BOpen the file in a browser
CRestart your computer
DInstall a web server
Which of these is NOT a use case for Node.js?
ARunning JavaScript on a server
BBuilding web servers
CStyling web pages with CSS
DWorking with files on your computer
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.