What is memoization?
Memoizing in simple terms means that memorizing or storing in memory. Sometimes, a function can become expensive to call multiple times in a program. But there's a way you can optimize such functions and make them execute much faster is called "caching" . Memoization is a way for your function to remember (cache) the results.
This technique is specially useful when it comes to dynamic programming . A memoized function is usually faster because if the function is called subsequently with the previous value(s), then instead of executing the function, would be fetching the result from the cache .
From the above example you can understand that instead of taking all arguments at one time, takes the first one and return a new function that takes the second one and returns a new function which takes the third one, and so forth, until all arguments have been fulfilled.
What is Object Destructuring?
In the above code the boolean operand will be converted to an integer: false becomes 0, true becomes 1. Then the two values are compared.
Above code converts 50 (a number) to string, done by the + operator .
What is the output of the following code?
Above code return false .
Since the floating point numbers are encoded in binary format , the addition operations on them lead to rounding errors . So, the comparison of floating points doesn't give expected results because of float point math problem .
What is Same Origin Policy?
The Same Origin Policy (SOP) is a security measure standardized among browsers. It is needed to prevent Cross-Site Request Forgery (CSRF). The "Origin" mostly refers to a "Domain". Same Origin Policy prevents different origins (domains) from interacting with each other, to prevent attacks such as CSRF (Cross Site Request Forgery) through such requests, like AJAX. In other words, the browser would not allow any site to make a request to any other site. Without Same Origin Policy , any web page would be able to access the DOM of other pages.
What is prototypal Inheritance?
The only drawback is that WeakSets are not enumerable . You can't iterate over a list of entries, probably because this would likely "touch" those entries and so defeat the purpose of WeakSet concept.
What are arrow functions?
Arrow functions introduced in ES6 and it aimed to address and resolve several usual pain points of traditional function expressions. They utilize the => syntax , which looks like an arrow.
Arrow functions allow you to write shorter function syntax.
Is same as,
Arrow functions are more like function statements , except that they bind the this to the parent scope. The this keyword inside an arrow function , does not refer to the object calling it rather inherits its value from the parent scope.
What is the use of the "debugger" keyword?