March 2019
Intermediate to advanced
208 pages
5h 11m
English
Objects are the JavaScript data structure you’ll almost certainly be working with the most. As we discussed in the chapter on records and modules, ReasonML records aren’t objects. However, to interoperate with JavaScript objects, we’ll use a type definition that looks a lot like that of a record.
Consider this JavaScript object, which describes metadata from Papa Parse, a JavaScript module that parses comma-separated value files:
| | { |
| | delimiter: // Delimiter used |
| | linebreak: // Line break sequence used |
| | aborted: // Whether process was aborted |
| | fields: // Array of field names |
| | truncated: // Whether preview consumed all input |
| | } |
We represent this data type as follows. To make the example a bit clearer, ...
Read now
Unlock full access