What is a closure and how do you use it

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. Definition of the Closure given by Douglas Crockford: crockford.com/javascript/private.html Example: Closure is useful in hiding implementation detail in JavaScript. In other Leggi tutto

What is a Promise?

A promise is an object that may produce a single value some time in the future: either a resolved value, or a reason that it’s not resolved (e.g., a network error occurred). A promise may be in one of 3 possible states: fulfilled, rejected, or pending. Promise users can attach Leggi tutto

JavaScript interview questions

https://dev.to/coderbyte/a-javascript-interview-question-asked-at-google-19f1 https://dev.to/coderbyte/a-tricky-javascript-interview-question-asked-by-google-3gnf https://github.com/sudheerj/JavaScript-Interview-Questions https://github.com/sadanandpai/javascript-code-challenges https://www.geeksforgeeks.org/top-50-array-coding-problems-for-interviews/ https://github.com/prabaprakash/Hackerrank-JavaScript-Solutions