Cameron McCormack a écrit :
Marcos Caceres:
  
Using ( ) in ({ ...}) is mostly convention (ie. evaluate all inside { },
like you would with say x = (3 + (4 * 3)) ).
    

And more importantly, it distinguishes it from a code block, which is
what it would be parsed as otherwise since it is at the beginning of the
statement/_expression_.

  >>> { a: 1, b: 2}
  org.mozilla._javascript_.EvaluatorException: missing ; before statement (System.in#2)
  >>> ({ a: 1, b: 2 })
  [object Object]
  
Thanks Cameron and Marcos. Indeed this makes a difference.

Regards,

Cyril

Reply via email to