The state of the documentation is really a PITA, as the object do not specify details on the returned value, error conditions and so on.
For built-in objects it may help looking at the Javascript standard and look if the object do not appear to be present. For example JSON make its apparition in 1.8 but is not in the list of objects.
It sometimes help to look at the PCL documentation or source - and sometime not.
Also for the UI stuff, the QT doc may (or may not) give some hints.
In general it is safer to work by cut and paste, especially with the UI components.
It is quite easy to crash PI with an error in Javascript (at least as soon as you do non trivial stuff). So it is better to save your work before testing a script.
Otherwise it is quite a power tool...
-- bitli