DEV Community

PUSHAN VERMA
PUSHAN VERMA

Posted on

2 1

Hoisting and Temporal Dead Zone

Hoisting

console.log('varname',varName);
var varName;
console.log('varname',varName);
varName ="captain america";
console.log('varname',varName);

fn();
function fn()
{
console.log("hello from fn");
}
fn();

Image description

Temporal Zone

//temporal dead zone is a zone where the variable is in accesible

with var
console.log(a);
var a =2;
op-undefined

with let
console.log(b);
let b=3;

op -(Error ) Missing initializer in const declaration

with const
console.log(c);
const c=4;

op -(Error ) Missing initializer in const declaration

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more