Какой лучший способ получить доступ к моей переменной this.rules из $.each()? Любое объяснение того, почему и как было бы полезно!
app.Style = function(node) {
this.style = node;
this.rules = [];
var ruleHolder = node.find('Rule');
$.each(ruleHolder, function(index, value) {
var myRule = new app.Rule($(ruleHolder[index]));
this.rules.push(myRule);
});
console.log(this.rules)
}