Stone Zhong
8/21/2015 6:22:00 AM
On Thursday, August 20, 2015 at 11:20:26 PM UTC-7, Stone Zhong wrote:
> Hi there,
>
> I wrote some code below (Format A) by mistake:
>
> Format A:
> ------------------
> var a = {
> x: 1,
> y: 2,
> foo() {
> alert("foo");
> },
> };
>
> Actually I intend to write (Format B):
>
> Format B:
> ------------------
> var a = {
> x: 1,
> y: 2,
> foo: function() {
> alert("foo");
> },
> };
>
> However, to my surprise, Format A works well in Firefox 38.2.0, I haven't tried other browser, am I missing anything? I thought Format A's syntax is wrong.
>
> Thanks,
> Stone
Another ES5 black magic?