Trying to do a if statement in a client side function. If the statement is true, you proceed with the action. If not, you exit from the function. Is this possible?
doInit : function(component, event, helper) {
if (this is true) {
var action = component.get("c.getPickListValuesFromSubjects");
action.setCallback(this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
var pickListValues = response.getReturnValue();
component.set("v.optionsForSubject", pickListValues);
}
else {
console.log(state);
}
});
$A.enqueueAction(action);}
exit;
},