Skip to content

Instantly share code, notes, and snippets.

@wingyplus
Created October 21, 2020 06:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wingyplus/984c5f8eeb922ee0ff89264d7601aeed to your computer and use it in GitHub Desktop.
Save wingyplus/984c5f8eeb922ee0ff89264d7601aeed to your computer and use it in GitHub Desktop.
[None, Some(1), Some(2), None, Some(10)]
->Js.Array2.filter(a => Belt.Option.isSome(a))
->Js.Array2.map(n => Belt.Option.getExn(n))
->Js.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment