Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

A variable is only valid inside a certain scope. The memory occupied by the variable’s value is freed at the end of the scope. In the following example, the scope is explicitly represented by curly braces:

Outside of the scope, the variable does not exist:

Error: the binding `x` is available in a different scope in the same function
   ╭─[ command_2:1:1 ]
   │
 2 │   let x = 1;
   │       ┬  
   │       ╰── help: the binding `x` is available in a different scope in the same function
───╯