Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

let 0 be a valid find

  • Loading branch information...
commit 49e02fecba840e9a75469e218e700e40b1b7fd81 1 parent 3b83602
@marcuswestin authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 pickOne.js
View
4 pickOne.js
@@ -6,12 +6,12 @@ module.exports = function pickOne(items, fn) {
if (isArray(items)) {
for (var i=0; i<items.length; i++) {
result = fn(items[i], i)
- if (result != null && result != false) { return result }
+ if (result != null && result !== false) { return result }
}
} else {
for (var key in items) {
result = fn(items[key], key)
- if (result != null && result != false) { return result }
+ if (result != null && result !== false) { return result }
}
}
return null
Please sign in to comment.
Something went wrong with that request. Please try again.