0% found this document useful (0 votes)
6 views1 page

JavaScript Interview Questions Answers

The document provides JavaScript interview questions and answers for candidates with over three years of experience. It explains the differences between `var`, `let`, and `const`, highlighting their scopes and redeclaration rules, as well as the concept of hoisting in JavaScript. The content is presented in both English and Hinglish for better understanding.

Uploaded by

Irfan Ahmad
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

JavaScript Interview Questions Answers

The document provides JavaScript interview questions and answers for candidates with over three years of experience. It explains the differences between `var`, `let`, and `const`, highlighting their scopes and redeclaration rules, as well as the concept of hoisting in JavaScript. The content is presented in both English and Hinglish for better understanding.

Uploaded by

Irfan Ahmad
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

JavaScript Interview Questions &

Answers (3+ Years Experience Level)


1. Difference between var, let, and const?
**English:**
`var` is function-scoped and allows redeclaration; it’s hoisted with `undefined`. `let` and `const`
are block-scoped. `let` allows reassignment but not redeclaration, while `const` does not allow
either. Use `let` for mutable and `const` for immutable references.

**Hinglish:**
`var` ka scope function ke andar hota hai aur usko redeclare bhi kar sakte hain. `let` aur `const`
block scoped hote hain. `let` ko update kar sakte hain but dobara declare nahi kar sakte. `const`
na hi update ho sakta hai, na hi redeclare.

2. What is hoisting in JavaScript?


**English:**
Hoisting is JavaScript’s behavior of moving declarations to the top of the scope during
compilation phase. Variables declared with `var` are hoisted with value `undefined`, whereas
`let` and `const` are hoisted but stay in Temporal Dead Zone until initialized.

**Hinglish:**
JavaScript me hoisting ka matlab hota hai variable ya function ke declaration ko scope ke top pe
le jana. `var` undefined ke saath hoist hota hai, jabki `let` aur `const` sirf hoist hote hain lekin
TDZ me rehte hain jab tak unhe assign nahi karte.

You might also like