reduce function for array in javascript

Parameters callback Function to execute on each value in the array, taking four arguments: previousValue The value previously returned in the last invocation of the callback, or initialValue, if supplied. (See below.) currentValue The current element being processed in the array. index The index of the current element being processed in the array. array The…

prototype vs __proto__ in js

short version __proto__ is the actual object that is used in the lookup chain to resolve methods, etc. prototypeis the object that is used to build __proto__ when you create an object with new   long version prototype is a property of a Function object. It is the prototype of objects constructed by that function….

delete in js

The delete operator removes a property from an object. delete is only effective on an object’s properties. It has no effect on variable or function names. If the object inherits a property from a prototype, and doesn’t have the property itself, the property can’t be deleted by referencing the object. You can, however, delete it…