The following table shows supported Util functions:
Util Class | Description | Example Code |
addClass (Object elementString newClass) |
Adds a CSS class to a component. |
var myCmp = component.find("myCmp"); $A.util.addClass(myCmp, "myClass"); |
getBooleanValue (object val): Boolean | Coerces truthy and falsy values into native Booleans. | |
hasClass (Object elementString className): Boolean |
Checks whether the component has the specified CSS class. |
//find a component with aura:id="myCmp" in markup var myCmp = component.find("myCmp"); $A.util.hasClass(myCmp, "myClass"); |
isArray (Object obj): Boolean |
Checks whether the specified object is an array. |
|
isEmpty (Object obj): Boolean |
Checks whether the object is ... |