67
rated 0 times
[
69]
[
2]
/ answers: 1 / hits: 87220
/ 10 Years ago, tue, january 20, 2015, 12:00:00
I have this array:
var fruits = ['Apple', 'Banana', 'Orange', 'Celery'];
And I use Lodash's remove
like so:
_.remove(fruits, function (fruit) {
return fruit === 'Apple' || 'Banana' || 'Orange';
})
The result is ['Apple', 'Banana', 'Orange', 'Celery']
, while I expected it to be ['Apple', 'Banana', 'Orange']
. Why is this so?
More From » lodash