Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update index.js #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all 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
8 changes: 5 additions & 3 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*/) {
if(!Array.isArray(arr)) return arr;

var len = arguments.length;
var idx = 0;
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