These are chat archives for gkz/LiveScript

24th
Jun 2016
austinfrey
@austinfrey
Jun 24 2016 01:30
What is the shorthand for writing a key value in an object where key and value are the same. name: name I remember seeing it but can't find it
Joy Krishna Mondal
@JoyKrishnaMondal
Jun 24 2016 01:31
:+1: also would like to know
austinfrey
@austinfrey
Jun 24 2016 01:36
@JoyKrishnaMondal {name} someone on IRC gave me the info
Riley Cat
@WreckedAvent
Jun 24 2016 03:20
the same syntax also works in reverse for parameter lists
name = 'john'

({ name }) -> console .log name 
<| ({ name })
prints 'john'
Joy Krishna Mondal
@JoyKrishnaMondal
Jun 24 2016 04:06
oh wow !
didn't know that
ven
@vendethiel
Jun 24 2016 07:08
parameter lists are just big assignment thingies.
(name ? throw new TypeError "this argument is mandatory") -> works as well
well, they're actually even more powerful, since they allow unary operators:
(^^a) -> # equivalent to (a) -> a = ^^a
austinfrey
@austinfrey
Jun 24 2016 12:02
Thanks all