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

Console.log with return value

$
0
0

more generally, I’d be in favor of having a function that applies a side effect and returns its parameter, we could call it tap, I find it more flexible:

let tap = (x, f) => {
  f(x)
  x
}

let foo = "foo"->tap(Console.log)

Viewing all articles
Browse latest Browse all 2592

Trending Articles