Skip to content

Commit

Permalink
fix add
Browse files Browse the repository at this point in the history
  • Loading branch information
5saviahv committed Jan 6, 2021
1 parent 1ebe05a commit 5dbfabe
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/api/traversing.js
Original file line number Diff line number Diff line change
Expand Up @@ -902,14 +902,8 @@ exports.end = function () {
*/
exports.add = function (other, context) {
var selection = this._make(other, context);
var contents = uniqueSort(selection.get().concat(this.get()));

for (var i = 0; i < contents.length; ++i) {
selection[i] = contents[i];
}
selection.length = contents.length;

return selection;
var contents = uniqueSort(this.get().concat(selection.get()));
return this._make(contents);
};

/**
Expand Down

0 comments on commit 5dbfabe

Please sign in to comment.