➊ Functions - Basics
➋ Function Scope
➌ Function Arguments
➍ Anonymous Functions
➎ Higher Order Function & Callbacks
➏ Closure
➐ IIFE
➑ Arrow Functions
🚥 Disclaimer
⬖ The questions covered here are mostly conceptual.
⬘ I never claim only these type of questions are/should be asked during interviews.
⬗ For interviews, you should have fundamentals strong. And you should be able to provide solutions to practical problems.
➊ Functions - Basics
➀ Can a function name be used like a normal variable?
➁ What is the difference between "myFunction" and "myFunction()"?
➂ Does every function in JS return something even if not explicitly stated? If yes, what does it return by default?
➋ Function Scope
➀ What is a function scope?
➁ How does hoisting work inside a function body?
➂ Among var, let and const, which one does support hoisting?
➌ Function Arguments
➀ What is the difference between function parameters and function arguments?
➁ What is "arguments" reference inside a function body? What purpose does it solve?
➂ Is "arguments" an array? Explain its behaviour.
➃ What is a "Variadic Function"?
➄ What are different ways to access variable number of arguments passed to a function inside its body?
➅ What is a rest parameter operator? How does it work inside function's parameters list?
➆ Define some valid and invalid use cases of rest parameter?
➇ Define significant differences between "arguments" and "a rest parameter".
➍ Anonymous Functions
➀ What are different ways of defining a function?
➁ What is an anonymous function?
➂ Where will an anonymous function be useful? Give some examples of valid use cases.
➃ What is the difference between
❍ function a() {}
❍ let a = function() {}
➄ Are all JavaScript function declarations hoisted?
➎ Higher Order Function & Callbacks
➀ What is a callback function?
➁ Highlight some use cases for callback functions?
➂ Mention few in-built functions that accepts a callback.
➃ What is a higher order function (HOF)?
➏ Closure
➀ Define what is a closure.
➁ When does JavaScript create a closure?
➂ What is a lexical scope?
➃ Define various scopes within a closure.
➄ Why do you think closure is useful?
➅ Highlight few disadvantages of closures.
➐ IIFE
➀ What is IIFE?
➁ Highlight some use cases of IIFE.
➂ Why do we see less usage of IIFE these days? What are its alternatives?
➑ Arrow Functions
➀ What is an arrow function?
➁ Which ES version introduced arrow function?
➂ Given a normal function, convert it into an arrow function.
➃ When is it not mandatory to include arguments inside ( and ) in an arrow function?
➄ When does an arrow function return implicitly even if no return keyword is specified?
➅ What are some key differences between a normal and an arrow function?
⚠️ Repost Notice ⚠️
⬖ Though this is my original work, it was previously posted in [CHIRPBIRDICON]
⬘ Many questions have been taken from the original 🧵
⬙ If you liked these questions and do feel others might learn from it, please support.
End of 🧵
Are you looking for Interview Questions? I am sharing interview questions on DSA, SQL, HTML/CSS, JavaScript and React.
If you are interested, Follow me ✅
• • •
Missing some Tweet in this thread? You can try to
force a refresh