Hi, there's a difference in the JavaScript you use for web pages, AcroForms (= static PDF forms created with Adobe Acrobat) and XFA forms (static or dynamic forms created with AEM Forms/LiveCycle Designer).
Acrobats scripting API uses a JavaScript subset of ECMAScript 262 5th edition. There's a reference manual available, that explians the Adobe-specific methods of this API. All other methods are explained online.