{
  "schema_version": "1.0",
  "codex": "thecodex.expert/coding",
  "type": "concept",
  "slug": "concepts/scope",
  "name": "Scope",
  "section": "CS Concepts",
  "canonical_definition": "Scope is the region of a program's source code within which a given name binding is visible and can be referenced \u2014 determined either by the lexical structure of the source text (lexical scope, used by most modern languages) or by the runtime call chain (dynamic scope), with inner scopes able to shadow names from outer scopes.",
  "confidence": "high",
  "last_verified": "2026-06-01",
  "source_count": 4,
  "url": "https://thecodex.expert/coding/concepts/scope/",
  "concept_relationship": {
    "requires_first": [
      "concepts/functions",
      "concepts/variables"
    ],
    "enables": [
      "concepts/closures",
      "concepts/modules"
    ],
    "commonly_confused_with": [
      "scope != lifetime",
      "var != let in JS",
      "Python has no block scope"
    ]
  }
}