Skip to main content

Variable Not in Scope

Erroneous Code Example

This error occurs when you try to reference a variable that is not currently in scope or has not been declared. In this example, the variable userId is not declared.

Solution

Declare the variable as a parameter before using it.