خرید بک لینک

Vote count: 0

I have an array in JavaScript which contains different types of values:

[1, "abc", bool, 2, "efg", false, ... ]

I want to pass this array to an OCaml program by Js_of_ocaml. Because all the elements of an array in OCaml must have the same type. I don't know where (on the JS side or OCaml side?) and how to make this conversion.

Should I add type information to array elements on the JS side? I guess we need to build finally a variant type on the OCaml side?

Could anyone tell me what's the best way to realise this?

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 5 تير 1395 ساعت: 9:33

صفحه بندی