4 ms·
Rules for this in JS from top to bottom in priority: 1. The function was called with 'new' 2. The function was called with 'call' or 'apply' specifying an exp
by baron816 9y ago
Rules for this in JS from top to bottom in priority:
1. The function was called with 'new'
2. The function was called with 'call' or 'apply' specifying an explicit this
3. The function was called via a containing/owning object (context)
4. DEFAUL: global object (expect strict mode--undefined)
- ghusbands 9y agoYou missed out Function.prototype.bind