I have this javascript Object named group.
I am trying to add another object into this called Rule if the group.Rule object is null. My code is like so:
var ruleObj = {
Id: null,
RuleId: null,
MatchLogic: 0,
Min: null,
Max: null,
TagIds: null
};
group.Rule = group.Rule == null ? group.Rule = ruleObj : group.Rule;
I would think that group.Rule = ruleObj
would do it but console logging it shows that group.Rule
is {}
empty.
How do I add the group.Rule object onto group?