The pop() here will remove the last item in the array, only to add it
later with a push() a few lines later. Instead use a shift() to
preserve the order.
Signed-off-by: James Fournie <james.fournie@gmail.com>
Signed-off-by: Remington Steed <rjs7@calvin.edu>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
service.removeField = function (type, field) {
var new_list = [];
while (service[type].length) {
- var f = service[type].pop();
+ var f = service[type].shift();
if (field.index != f.index ) new_list.push(f);
}
new_list.forEach(function(f) {