Java Script
What is the closure in JavaScript? A closure is a combination of a function bundle together(enclosed) With references to its surrounding state(the lexical environment). In other words, a closure gives access to an outer function scope from an inner function? What is hoisting in Java script? When we declare a variable and it is moved to the top of the code. It is Called as hoisting Hoisting refers to the process by the interpreter, appears to move the declaration to the top of the code before execution. Variables can be affected before they are declared in the JavaScript JavaScript, only hoists declaration and not initialisation. Will be undefined until the line where is initialisation is reached. What is the promise in Java script? A promise is a Promise of court execution. The code, either executes or fails to execute In both cases, the subscriber will get notification. Let promise = new Promise(function (resolve,reject){}); Resolve and reject are to callbacks provided by JavaScript