Let's Learn Vocabularies
আপনি এখনো কোন Lesson Select করেন নি
একটি Lesson Select করুন।
Frequently Asked Questions
1. What the difference between var, let, and const?
✔ Use const by default for variables that don't change.
✔ Use let if you need to reassign the variable.
❌ Avoid var, as it can cause unexpected behavior due to function-scoping and hoisting.
✔ Use let if you need to reassign the variable.
❌ Avoid var, as it can cause unexpected behavior due to function-scoping and hoisting.
2. What the difference between map, forEach, and filter?
✔ Use map() to transform data.
✔ Use forEach() for actions like logging.
✔ Use filter() to get a subset of an array.
✔ Use forEach() for actions like logging.
✔ Use filter() to get a subset of an array.
3. Explain arrow functions and how they are different from
regular functions?
Arrow functions (=>) are a more concise way to write functions in
JavaScript.
However, they behave differently from regular functions in some key aspects.
✔ Use arrow functions for short functions and callbacks.
✔ Use regular functions when this, arguments, or new is required.
However, they behave differently from regular functions in some key aspects.
✔ Use arrow functions for short functions and callbacks.
✔ Use regular functions when this, arguments, or new is required.
4. How JavaScript Promises work?
✔ Promises handle async operations, preventing callback hell.
✔ Use .then() for success, .catch() for errors, and .finally() for cleanup.
✔ Chaining helps run multiple async tasks sequentially.
✔ async/await makes code more readable while working with Promises.
✔ Use .then() for success, .catch() for errors, and .finally() for cleanup.
✔ Chaining helps run multiple async tasks sequentially.
✔ async/await makes code more readable while working with Promises.
5. How closures work in JavaScript?
✔ Closures allow functions to remember variables from their outer
scope.
✔ Useful for private variables, function factories, and delaying execution.
✔ Be careful when using closures inside loops (use let instead of var).
✔ Useful for private variables, function factories, and delaying execution.
✔ Be careful when using closures inside loops (use let instead of var).