Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 1823

Cannot able create a Record from another Record (With all optional keys)

$
0
0

As you can see in the playground, the generated JS code for the mapper function is the following:

function mapper(a) {
  return {
          t: a.t,
          l: intToString(a.l),
          p: arrayToString(a.p)
        };
}

What JS code would you write to achieve what you’re looking for?

By the way, what is the problem with having present and undefined fields instead of absent fields?


Viewing all articles
Browse latest Browse all 1823

Trending Articles