Skip to content

Instantly share code, notes, and snippets.

@n4ru
Created January 13, 2015 23:51
Show Gist options
  • Save n4ru/f899e15ac977d662a321 to your computer and use it in GitHub Desktop.
Save n4ru/f899e15ac977d662a321 to your computer and use it in GitHub Desktop.
Adding qty of value to list array
addCards: function (elemone, elemtwo, elemthree) {
var self = this;
$(elemone).each(function(i, el) {
var values = $(elemtwo, this).text();
self.list.push(values);
i = 0;
console.log($(elemthree, this).text().replace(/(\d+)(?!.*\d)/g, $1));
while (++i < parseInt($(elemthree, this).text())) {
self.list.push(values);
}
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment