- 3) What is difference between Closure and scope?
- Closure enables the use of nested functions that are used to get the values created in the execution context of that of the parent function.
- They can prove as a perfect solution while solving a problem of hierarchy in any program.
- They have huge importance as far as functional programming is concerned. It solves the for loop problem of functional programming.
- It is also used to simulate private scope for variables.
An object that is able to produce a single value sometime in the future is known as Promise. The single value may either be a resolved value, or it can be a reason that it’s not resolved. There can be three states in which Promise can be:
There can be callbacks that can be attached to handle the fulfilled value or the rejection’s reason, this can be done by the Promise users.
Related Interview Questions
Node JS Interview Questions with Express
Ajax Interview Questions
Aurelia Interview Questions
Backbone js Interview Questions
D3.js interview questions
Ecmascript 2017 Interview Questions
Emberjs Interview questions
ES6 Interview Questions
Ext js Interview Questions
Grunt js Interview questions
Gulp Js interview questions
Handlebars js interview questions
JQuery Interview Questions
JSON Interview Questions
Knockout js Interview Questions
Koa Js Interview questions
Less.js interview questions
Marionette js interview questions
Phantomjs Interview Questions
Subscribe Our NewsLetter
Never Miss an Articles from us.
- Most Common Interview Questions
- Python Flask Interview Questions
- NoSQL interview questions
- JQuery Interview Questions
- C programming interview questions
- AngularJS Interview Questions
- Node JS Interview Questions with Express
- Core Java interview questions
- HTML Interview Questions
- Laravel interview questions
- Wordpress Interview Questions
- PHP Interview Questions