There are two options for using JS SKD on Directual:
Inline JS executing
JS SDK steps (Action and Condition)
At the moment Directual JS SDK is based on ES5
Typical cases for applying JS SDK:
Dealing with arrays;
Dealing with dates;
Complex string processing (e.g. converting).
Check out the following:
List of useful standard JS-functions;
List of internal $D methods.