Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
cleanup find() method a little
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Armstrong committed May 16, 2019
1 parent 984ba81 commit 17cbd8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function set(obj, path, value) {

function find(list, predicate) {
// 1. Let O be ? ToObject(list value).
if (list == null) {
if (list === null || typeof list === 'undefined') {
throw new TypeError('"list" is null or not defined');
}

Expand All @@ -59,7 +59,7 @@ function find(list, predicate) {
}

// 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
var thisArg = arguments[1];
var thisArg = arguments[2];

// 5. Let k be 0.
var k = 0;
Expand Down

0 comments on commit 17cbd8c

Please sign in to comment.