Why an empty Array type-converts to zero? +[]
In a brief, there are two key points: The toString method of an empty array returns an empty string. An empty string coerces to zero using the unary plus operator or the Number constructor called as a function (e.g. +”” === 0;). For example, we can use an object that defines a toString method, and … Read more