Let's Learn Vocabularies
আপনি এখনো কোন Lesson Select করেন নি ।
একটি Lesson Select করুন।

এই Lesson এ এখনো কোন Vocabulary যুক্ত করা হয়নি ।
নেক্সট Lesson এ যান
Frequently Asked Questions
Question-1. What is the difference between var, let, and const?
Answer-1. 'var' is function-scoped, can be redeclared, and is hoisted
with undefined. 'let' is block-scoped, cannot be redeclared, and is hoisted but not initialized. 'const' is
block-scoped, cannot be redeclared or reassigned, and is hoisted but not initialized.
Question-2. What is the difference between map(), forEach(), and
filter()?
Answer-2. 'map()' transforms elements and returns a new array.
'forEach()' runs a function on each element but does not return a new array. 'filter()' returns a new array
with elements that pass a condition.
Question-3. Explain arrow functions and how they are different from
regular
functions?
Answer-3. Arrow functions (=>) are a shorter syntax for writing
functions in JavaScript. A. 'this' binding: Arrow functions do not have their own 'this'; they inherit it
from the surrounding scope. B. Syntax: Arrow functions are more concise and do not require the function
keyword. C. Cannot be used as constructors: Unlike regular functions, arrow functions cannot be used with
'new'. D. No arguments object: Arrow functions do not have their own arguments object.
Question-4. How do JavaScript Promises work?
Answer-4. A Promise is an object that represents the eventual completion
(or failure) of an asynchronous operation. There are 3 possible states of a Promise such as a. Pending: The
initial state, operation not yet completed. b. Fulfilled: The operation was successful. c. Rejected: The
operation failed. To handle a Promise we can use '.then()' for success, '.catch()' for errors, and
'.finally()' for code that runs regardless of success or failure. 'async/await' makes working with Promises
easier by allowing asynchronous code to look like synchronous code.
Question-5. How do closures work in JavaScript?
Answer-5. A Closure is a function that remembers and can access
variables from its outer scope even after the outer function has finished executing. A function "closes
over" the variables it depends on, keeping them in memory even after the outer function returns. It is
useful in creating private variables, managing states in functional programming, event handling and
callbacks.