Brendan Eich wrote:
CoffeeScript has foo?.bar ... and foo.baz?(...) in lieu of

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

and

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


Correction: the ?( operator compiles like so:

$ echo 'foo={};foo.baz?()' > /tmp/foo2.cs
$ ./bin/coffee -p !$
./bin/coffee -p /tmp/foo2.cs
(function() {
  var foo;

  foo = {};

  if (typeof foo.baz === "function") {
    foo.baz();
  }

}).call(this);

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

Reply via email to