Reputation: 92581
I have an array which contains objects, these objects are in the same order and correspond to the li
's of a ul
.
I was wondering if there was any negligible difference between doing:
(this.element is the ul
's)
this.element.children(".tagit-choice:last").remove();
vs
(this.tagsArray is the array of objects about the li
's)
this.tagsArray[this.tagsArray.length -1].element.remove();
or is there a better way (noting that when this is called tagsArray will always have something in it, so getting an index of -1 is not an issue)?
Upvotes: 1
Views: 87
Reputation: 150253
Choose the more readable and maintable option:
.children(".tagit-choice:last").remove();
Upvotes: 1