Skip to content

Instantly share code, notes, and snippets.

@kjirou
Created September 22, 2013 23:35
Show Gist options
  • Save kjirou/6664902 to your computer and use it in GitHub Desktop.
Save kjirou/6664902 to your computer and use it in GitHub Desktop.
引数定義内でオブジェクトを変数に展開できる
func = ({foo:x, bar:y}) -> console.log x, y
func({foo:1, bar:2}) # -> "1 2"
func = ([a, b]) -> console.log a, b
func([3, 4]) # -> "3 4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment