elixir_script v0.16.0 Release Notes
Release Date: 2016-02-27 // about 7 years ago-
โ Added
- Bitstring pattern matching
- Bitstrings in for comprehensions
- Functions with catch, after, else clauses
with
special form- ๐ Pin operator in map keys and function clauses
- โ Added
Kernel.object/1
function to make it more natural to create a JavaScript object with string keys. Elixirscript, by default turns the following,%{a:"b"}
into{[Symbol.for("a")]: "b"}
in JavaScript. In order to get string keys, one would have to do%{"a" => "b"}
which turns into{a: "b"}
in JavaScript. WithKernel.object
, you can create string keyed maps conveniently,object(a: "b")
which turns into{a: "b"}
.
NOTE: when updating the created by, you still have to use the string form
%{ my_map | "a" => "c" }
โ Removed
- โก๏ธ
JS.update(object, property, value)
has been removed and replaced withJS.update(object, map)
. This allows you to update multiple values on a javascript object at once.
๐ Fixed
- Optional parameters should now work as expected