# Exit Point

**Description**:

Result (verifiable externally) obtained by executing a [unit of code](https://blog.fiftywords.co/unit-of-code).

**Types (RED)**:

- [Return value](https://blog.fiftywords.co/return-value-exit-point). (Easiest to verify).
- [Effect, change of state](https://blog.fiftywords.co/change-of-state-exit-point)
- [Dependency, call to external](https://blog.fiftywords.co/external-dependency-exit-point). (Hardest to verify)

```ts
let currentValue = 0;

function additionWithLogging(summand: number, logger: ILogger): number {
  /** Exit point 1 => external dependency call (D) */
  logger.log(`Will add: ${currentValue} + ${summand}`);
  /** Exit point 2 => effect, change of state (E) */
  currentValue += summand;

  /** Exit point 3 => return value (R) */
  return currentValue;
}
```

Every [unit of code](https://blog.fiftywords.co/unit-of-code) has exit point(s).

**Only one exit point is verified per [unit test](https://blog.fiftywords.co/unit-test)**

[🇨🇴 Versión en Español](https://blog.cincuentapalabras.co/punto-de-salida)
