breuleux / earl-grey

Programming language compiling to JavaScript
http://breuleux.github.io/earl-grey/
MIT License
464 stars 6 forks source link

How do I define an empty object literal? #8

Closed davej closed 9 years ago

davej commented 9 years ago

I realise that I can use the constructor: new Object(). But the object literal {} (in js) is much more quickly readable to me and also much more performant.

davej commented 9 years ago

Just realised that I can do let my-object = {=} to get an object literal. Awesome! Might be useful to document this because initialising object literals is quite a common pattern.

breuleux commented 9 years ago

I think I mention it in the interactive tutorial. Anyway, I added the information to the main documentation.