TUTORIAL VIDEO
INTERVIEW QUESTIONS
JavaScript is a lightweight, interpreted programming language used to create dynamic and interactive web content. Its main features include being object-oriented, event-driven, and supporting first-class functions.
JavaScript data types include:
- Primitive types: String, Number, Boolean, Undefined, Null, Symbol, and BigInt
- Non-primitive types: Object, Array, Function
- var: Function-scoped, allows re-declaration, and hoisted with undefined initialization.
- let: Block-scoped, does not allow re-declaration, and hoisted without initialization.
- const: Block-scoped, must be initialized during declaration, and cannot be reassigned.
== checks for equality after type conversion, while === checks for strict equality without type conversion.
A closure is a function that retains access to its outer scope, even after the outer function has executed. This allows functions to maintain state between executions.
Promises in JavaScript represent a value that is unknown when created but will eventually be resolved or rejected. They handle asynchronous operations by chaining methods like .then(), .catch(), and .finally().
Event delegation is a technique where a single event listener is added to a parent element to manage events for its child elements, improving performance and reducing memory usage.
JavaScript objects are collections of key-value pairs where values can be properties or methods. They are used to store structured data and functionality.
Hoisting is a behavior in JavaScript where variables and function declarations are moved to the top of their scope during the compilation phase, allowing them to be used before their declaration.
Synchronous programming executes tasks sequentially, blocking further execution until the current task is completed. Asynchronous programming allows tasks to run concurrently, enabling non-blocking operations.