1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-19 16:42:09 +03:00

fix lint errors

This commit is contained in:
David Baker
2015-11-05 13:57:21 +00:00
parent 0da547a239
commit ad80d4f059
2 changed files with 11 additions and 7 deletions

View File

@@ -152,10 +152,11 @@ module.exports.findElement = function(array, fn, reverse) {
*/
module.exports.removeElement = function(array, fn, reverse) {
var i;
var removed;
if (reverse) {
for (i = array.length - 1; i >= 0; i--) {
if (fn(array[i], i, array)) {
var removed = array[i];
removed = array[i];
array.splice(i, 1);
return removed;
}
@@ -164,7 +165,7 @@ module.exports.removeElement = function(array, fn, reverse) {
else {
for (i = 0; i < array.length; i++) {
if (fn(array[i], i, array)) {
var removed = array[i];
removed = array[i];
array.splice(i, 1);
return removed;
}