Back to JavaScript

JavaScript Tutorial

Scope and Hoisting

Understand where variables are available and how declarations are processed.

Scope controls where variables and functions can be accessed.

Hoisting describes how JavaScript processes some declarations before code runs.

javascript
function showTopic() {
  const topic = "JavaScript";
  console.log(topic);
}