Variables & Data Types
- What are the different data types in JavaScript?
- Difference between
var
,let
, andconst
with examples. - What is the default value of an uninitialized variable?
- How do primitive and reference types differ in JS?
- How is
typeof null
evaluated, and why?
Operators
- Explain the difference between
==
and===
. - What is the difference between
++a
anda++
? - How does the
+
operator behave with strings vs numbers? - What is the result of
NaN === NaN
and why? - Explain the
??
(nullish coalescing) operator with an example.
Functions
- What are function declarations vs function expressions?
- What are arrow functions, and how do they handle
this
? - Write a function to reverse a number.
- Explain default parameters in functions with an example.
- Write a function to check if a number is a palindrome.
🔹 Scope & Hoisting
- What is scope in JavaScript?
- Difference between global scope, function scope, and block scope.
- What is hoisting? Give an example with variables and functions.
- Why do
let
andconst
have a Temporal Dead Zone? - Explain closures and give a practical use case.
🔹 Coding Challenges
- Write a factorial function using recursion.
- Create a function to find the maximum number in an array.
- Write a function that counts vowels in a string.
- Implement a program to swap two numbers without a temporary variable.
- Build a simple calculator function that takes two numbers and an operator.
Top comments (0)