14 Tweets 3 reads Mar 15, 2023
Top 25 JavaScript Interview Questions and Answers in 2023.
Thread:
Q1. What are first-class functions?
In some programming languages, there is a concept of first-class functions. First-class functions are those treated like ordinary variables.
You can assign them to some other variable, pass them as an argument to other functions, and return them from another function.
For example, we can assign a function `x` to a variable called `y`.
Q2. What are the function statements and function expressions?
When a function gets created using the `function` keyword, it’s called a function statement. Assigning a function to a variable is a function expression.
Q3. What are first-order functions?
A first-order function does not take another function as an argument or return a function.
Q4. What are higher-order functions?
Higher-order functions can accept a function as an argument or return a function as a result.
Q5. What are pure functions?
Pure functions are those whose return values only depend on the arguments they receive. We get the same return value if we call a pure function with the same arguments.
Q6. What is function currying?
Function currying is a process in which we convert a function with multiple parameters to a chain of functions with a single parameter.
Q7. What is prototype chaining?
Prototype chaining is the process of building new objects from old ones. Essentially, it’s like inheritance in a class-based language.
Q8. What is the difference between the null and the undefined values?
Variables get assigned a `null` value to indicate they are declared and assigned but don’t point to anything. An `undefined` variable is declared but not initialized.
Q9. What is a strict mode in javascript?
ECMAScript 5 introduced a strict mode that executed the programs and functions strictly. To use strict mode, we write "use strict"; on the top of our JavaScript file.
Q10. What is the difference between == and ===?
The `==` operator is also called a type-converting equality check operator. When we compare values of different data types, it attempts to do type conversions before checking the equality.
The `===` operator is also called a strict equality operator. JavaScript engine will make no type conversions in this case.
Part 2 thread Coming Soon!
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...