1. What is the difference between double equal (==) vs triple equal (===)?
Double equal(==) is checking value but Triple equal(===) checking value and data type. Double equal is not stricter but triple equal is very stricter for value.
2.What is the difference between call, apply and bind in JS?
They have the same function, they are used to change the direction of this in the function. The difference between call, apply and bind is already clear.
3.What is window, global variable, global scope?
5.What is DOM?
DOM is a programmatic representation of a web page. A web page is made of different types of HTML elements. DOM builds a tree-like structure using these nodes where some nodes are parents, and other nodes are children
6.What is Functional Programming?
Functional code tends to be more concise, more predictable, and easier to test than imperative or object oriented code — but if you’re unfamiliar with it and the common patterns associated with it, functional code can also seem a lot more dense, and the related literature can be impenetrable to newcomers. There are a lot of ideas in the innocent looking definition above which all need to be understood before you can begin to grasp the meaning of functional programming:
- Pure functions
- Function composition
- Avoid shared state
- Avoid mutating state
- Avoid side effects
7.What is a Promise?
A promise may be in one of 3 possible states: fulfilled, rejected, or pending. Promise users can attach callbacks to handle the fulfilled value or the reason for rejection.Promises are eager, meaning that a promise will start doing whatever task you give it as soon as the promise constructor is invoked
A promise is an object which can be returned synchronously from an asynchronous function. It will be in one of 3 possible states:
onFulfilled()will be called (e.g.,
onRejected()will be called (e.g.,
- Pending: not yet fulfilled or rejected
8.What is a Closure?
Closures are important because they control what is and isn’t in scope in a particular function, along with which variables are shared between sibling functions in the same containing scope.A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment).
9.What is event bubble?
When an event is in an element within another element and all elements have registered a handle to that event, event bubbling is a form of event propagation in the HTML DOM API. It’s a process that begins with the element that caused the event and then moves up the hierarchy to the containing elements. The event is first captured and treated by the innermost element in event bubbling.
10.What is Prototypal Inheritance?
prototype property. (Functions can have properties because they are, in fact, objects).