Skip to content
Open
Changes from 1 commit
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
16 changes: 9 additions & 7 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.

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

var tlen = two.length
var olen = one.length;
var idx = -1;
var arr = [];
var olen = one.length,
tlen = two.length,
idx = -1,
arr = [];
Copy link
Owner

Choose a reason for hiding this comment

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

Please revert this and use the same formatting as the rest of the code.


while (++idx < olen) {
var ele = one[idx];
Expand Down