Skip to content

Instantly share code, notes, and snippets.

@keirah
Created March 25, 2018 04:19
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 keirah/ec1cd06d210e1557be75b5a7733de832 to your computer and use it in GitHub Desktop.
Save keirah/ec1cd06d210e1557be75b5a7733de832 to your computer and use it in GitHub Desktop.
[@bs.module] external lab : Js.t({..}) = "./lab.json";
let x = lab##components;
let x2 = Belt.List.fromArray(x);
/* Js.log2("length using array length: ", Belt.Array.length(x)); */
Js.log2("length using list length: ", Belt.List.length(x2));
Js.log(x2);
let third = Belt.List.get(x2, 2);
let unwrapThird = someVal =>
switch someVal {
| None => Js.log("nothing here")
| Some(value) => Js.log(value)
};
unwrapThird(third);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment