14 Tweets 7 reads Mar 15, 2023
Top 100 JavaScript Interview Questions and Answers in 2023:
Thread [Part 2]:
Here's part 1 of this JS Interview Questions threads series:
Q11. What are arrow functions?
An arrow function is a compact way of declaring a function. Functions declared using arrow syntax donโ€™t have this, arguments bindings.
First-class cannot use these functions to create a class constructor.
Q12. What is JSON?
JSON stands for JavaScript Object Notation. It stores data in a format similar to JavaScript objects.
Q13. What is hoisting?
Hoisting is the process by which the JavaScript engine sets aside memory for variables, functions, and classes to give the impression that they are at the top of the code.
Q14. What is memorization?
Memorization is a technique that saves calculated results to improve a functionโ€™s efficiency.
The arguments given to the function serve as the cache objectโ€™s key. If a key is present, the function returns the result immediately.
Otherwise, the function computes the result, saves it in the cache, and returns it.
Q15. What are closures?
A function bound to its immediate surroundings creates a closure.
Essentially, a function defined inside another function is a closure.
The variables and operations of the outer function are accessible to the inner function.
Q16. What is scope in JavaScript?
A scope is a code section allowing us to access specific variables and functions.
It determines the visibility of variables and functions.
Variables and functions declared within a particular scope cannot be accessible outside the scope.
Q17. What is the difference between local storage and session storage?
Both local storage and session storage store data.
Local storage persists the data even when we close the browser.
In contrast, session storage removes the data when we close the browser tab.
Q18. What is a JavaScript promise?
A promise is a JavaScript object that may or may not produce a value in the future. In other words, the promise object yields a single value when resolved.
A promise object can have one of three states: pending, fulfilled, and rejected.
Q19. What is a callback function?
A function passed as an argument to some other function is a callback function.
We will invoke the callback function within the function to accomplish the desired result.
Q20. What is callback hell?
Callback Hell is a pattern that consists of multiple nested callback functions.
It is an anti-pattern because the code is hard to read and modify.
That's a wrap!
If you enjoyed this thread:
1. Follow us @codedamncom for more of these.
2. Retweet the first tweet above to share with your friends.

Loading suggestions...