Advanced_JavaScript_Questions_Full (1)
Advanced_JavaScript_Questions_Full (1)
8. What are arrow functions, and how are they different from regular functions?
Arrow functions have a shorter syntax and do not have their own this, arguments, or prototype.
10. What is the difference between function declaration and function expression?
Function declarations are hoisted, whereas function expressions are not.
28. What is the difference between deep cloning and shallow cloning?
Shallow cloning copies object references, while deep cloning duplicates nested objects to create
independent copies.
41. What is the difference between Object.assign() and the spread operator?
Object.assign() copies properties from multiple sources, while the spread operator (...) provides a
more concise syntax for shallow copies.
43. What is the difference between a shallow copy and a deep copy?
A shallow copy copies object references, while a deep copy recursively clones all nested objects.
46. What is tail call recursion, and how does JavaScript optimize it?
Tail call recursion is when a recursive call is the last operation in a function, and JavaScript
optimizes it by reusing stack frames.