November 15, 2018
These are some intersting aspect that are different from other programing language.
To update field in the record, which means creating a new object from an object.
You can do it as follows:
{ model | keywords = model.keywords ++ [ model.newKeyword ] };
If you want to change multiple fields, you can specify it with a comma.
{ model | keywords = model.keywords ++ [ model.newKeyword ], newKeyword = "" };
There are few different ways to actually access to the model.
model.keywords;
.keywords model;
The keyword can act like a function. Pretty cool.