You are on page 1of 1

javaScript interview topics

1) difference between the var,let and const


Link - https://www.geeksforgeeks.org/difference-between-var-let-and-const-keywords-
in-javascript/

2) string interpolation
let text = `Welcome ${firstName}, ${lastName}!`;
Automatic replacing of variables with real values is called string interpolation.

3)Type Conversion and Coercion

4) What is the difference between == and === in JavaScript?


The == operator compares the values of two variables after performing type
conversion if necessary. On the other hand, the === operator compares the values of
two variables without performing type conversion.

5) use strict
-> Strict mode is a special mode, that we can activate in JavaScript. Which makes
it easier to write secure JavaScript code.
-> Without strict mode JavaScript simply fails silently, without showing where we
did the mistake.
-> When we use strict mode, we can easily avoid accidental errors. Basically, it
avoids bugs coming to your codes.
-> Strict mode makes several changes to normal Javascript semantics. Strict mode
eliminates errors that would be ignored in non-strict mode, thus making javascript
“more secured”. Strict mode prevents hard to catch bugs by ensuring that the syntax
is locked down tighter. It is generally syntax that a user may not mean to put
down, but has the potential to cause major headaches down the road.

What are the other advantages of "use strict" ?


-> Reserved Keywords cannot be used.
-> Deleting a variable/object/function in the strict mode is not allowed.
-> eval() is not allowed to create variables in the scope from which it was
called.
-> Octal escape characters are not allowed.

6)Destructuring Objects
7)Nullish Coalescing Operator (??)
8) Hoisting - Hoisting is JavaScript's default behavior of moving all declarations
to the top of the current scope (to the top of the current script or the current
function).

9)JavaScript Scope -
Block scope
Function scope
Global scope

You might also like