JavaScript-backed Objects
It is possible to back HTL logic with JavaScript. However, the preferred or recommended method is by using Sling Models.
NOTE
The JavaScript Use API has been deprecated for use with AEM as a Cloud Service. Please use the Java Use API instead.
Please see the AEM as a Cloud Service release notes for more information on deprecated and removed features.