Allen Wirfs-Brock wrote:
Note that in this and many other similar situations the isFoo method is actually redundant. You would get the same effect by saying:

  if (obj1.doFooishThings) obj1.doFooishThings();

this suggests that a useful operator might be a conditional property access, perhaps something like:

??obj.doFooishThings();

which parses as
CallExpression :
     ?? MemberExpression Arguments

If conditionally calls the value of the MemberExpression if it is not undefined.

CoffeeScript has foo?.bar ... and foo.baz?(...) in lieu of

  if (foo != null) foo.bar ...

and

  if (foo.baz != null) foo.baz(...)

where all ... are meta. We've talked about these a bit in TC39 but I don't recall any definite outcome.

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to