How to build js object?

You just have to use jsnew syntax.

Example:

let get_timestamp () =
  let date = jsnew Js.date_now () in
  int_of_float (Js.to_float (date##getTime ()))

More details in documentation: Js object constructor

◄ Back to the Quick Howto's