# Running Scripts & the REPL — Node.js

Source: https://www.geekswithgeeks.com/en/nodejs/node-running-repl

> Two ways to execute JavaScript with Node.

## Running a file

Save as `hello.js`, then run `node hello.js` in your terminal.

```javascript
console.log("Hello from Node!");
```

Output:

```
Hello from Node!
```

## The REPL

Running `node` with no file drops you into the **REPL** — a Read-Eval-Print Loop for quick experiments.

```bash
$ node
> 2 + 2
4
> const x = 10
undefined
> x * 2
20
> .exit
```

**Quiz:** What does REPL stand for?

- [x] Read-Eval-Print Loop
- [ ] Run-Execute-Process Line
- [ ] Remote Execution Protocol Layer

*Answer:* Read-Eval-Print Loop. It reads your input, evaluates it, prints the result, and loops.
