diff --git a/throttle.js b/throttle.js index 2dbfdf02b..287b9ce50 100644 --- a/throttle.js +++ b/throttle.js @@ -53,7 +53,7 @@ function throttle(func, wait, options) { let leading = true let trailing = true - if (typeof func != 'function') { + if (typeof func !== 'function') { throw new TypeError('Expected a function') } if (isObject(options)) { @@ -61,9 +61,9 @@ function throttle(func, wait, options) { trailing = 'trailing' in options ? !!options.trailing : trailing } return debounce(func, wait, { - 'leading': leading, + leading, + trailing, 'maxWait': wait, - 'trailing': trailing }) }