タグ

ブックマーク / 2ality.com (1)

  • Why is `(0,obj.prop)()` not a method call?

    This blog post explores references, a mechanism used by the ECMAScript language specification to explain the difference between the following two expressions: obj.prop() (0, obj.prop)() Method calls versus function calls  # Consider the following object: var obj = { getThis: function () { "use strict"; return this; }, }; If you call obj.getThis, you have a method call (this points to the object in

    shin1x1
    shin1x1 2018/04/27
    obj.call() = method call / (0, obj.call)() = function call
  • 1