Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
'use strict';

module.exports = function diff(arr/*, arrays*/) {
var len = arguments.length;
var idx = 0;
if(!Array.isArray(arr)) return arr;

var len = arguments.length,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a ; at the end of the line.

var ldx = 0;
while (++idx < len) {
arr = diffArray(arr, arguments[idx]);
}
Expand All @@ -20,9 +22,9 @@ function diffArray(one, two) {
if (!Array.isArray(two)) {
return one.slice();
}

var tlen = two.length

var olen = one.length;
var tlen = two.length;
var idx = -1;
var arr = [];

Expand Down