4 ms·
I find the destructuring logic in elixir much more interesting, and the watered down version in ES6 much more practical. In elixir you can pop off as many as y
by hinkley 2y ago
I find the destructuring logic in elixir much more interesting, and the watered down version in ES6 much more practical.
In elixir you can pop off as many as you like.
- liontwist 2y agoCan you share any resources about it?
- hinkley 2y agoI’m a bit of an elixir noob, but Enum functions like slice let you cut up lists in various ways, and you can pattern match values in maps in function definitions: http://www.skuunk.com/2020/01/elixir-destructuring-function.html http://www.skuunk.com/2020/01/elixir-destructuring-function.... Which can let you unroll function preambles, or apply different rules if for instance an admin user runs a function versus a regular user.