I want to use
var d = new Date(); var n = d.now();
I have written the following function (in
(`now`) obj args :== obj .# "now" .$ args getCurrentTime :: !*JSWorld -> (!Maybe Int,!*JSWorld) getCurrentTime world #! (date,world) = jsNew "Date" () world #! (ms,world) = (date `now` ()) world #! world = jsDelete date world = (jsValToInt ms,world)
Unfortunately, at run-time this generates the error:
TypeError: ABC.js.now is not a function.
So, how should I have written the above code?
Thanks in advance.