// Push items into array only if they aren't contained by it.
// Returns an array of the the new length of the array and modified array.

var difference = require('./difference')
var slice      = require('./slice')
var push       = require('./push')

function insert (arr, items) {
  items = Array.isArray(items)
    ? items
    : slice(arguments, 1)

  var diff = difference(items, arr)

  if (diff.length) push(arr, diff)

  return [arr.length, arr]
}

module.exports = insert

@@ -431,9 +431,8 @@
 urn 
-%5B
 arr.
@@ -441,14 +441,8 @@
 ngth
-, arr%5D
 %0A%7D%0A%0A

update array/insert — return arr.length only