© 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_5

5. Lists and Arrays

Danny Yang1  
(1)
Mountain View, CA, USA
 

ReScript has two first-class data structures that we can use to represent ordered collections of data: arrays and lists. Arrays are almost identical to JavaScript arrays, while lists are linked lists with immutable contents. In this chapter, we’ll go over syntax and examples for lists and arrays, and discuss differences and use cases for each one. We’ll also cover three important higher-order functions that can be used with collections: map, filter, and reduce.

Arrays

ReScript’s arrays will feel very familiar to readers coming from ...

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.