Skip to content

Commit

Permalink
faster way to check if the variable is an array
Browse files Browse the repository at this point in the history
  • Loading branch information
mankal111 committed Oct 15, 2018
1 parent 76d960d commit edfcfb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function checkIfOptionsIsObject(options) {
* @returns {boolean} True if parameter is an array
*/
function checkIfParameterIsArray(array) {
if (Array.isArray(array)) {
if (array.constructor === Array) {
return true;
}
throw new TypeError(`Parameter's type is '${typeof array}' but it should be 'array'.`);
Expand Down

0 comments on commit edfcfb9

Please sign in to comment.