© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
D. YangIntroducing ReScripthttps://doi.org/10.1007/978-1-4842-8888-7_4

4. Records and Objects

Danny Yang1  
(1)
Mountain View, CA, USA
 

In this chapter, we’ll learn about two more composite data types: records and objects. They are useful for representing structures with named fields, and have many similarities with objects in JavaScript. We’ll also discuss two different ways of thinking about types: structural and nominal typing.

Records

Records are another product type that can contain several values, similar to tuples. While tuples are a collection of ordered values, records are a collection of named values. Each record contains a number of fields with unique ...

Get Introducing ReScript: Functional Programming for Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.