static toggle(arr, value) {
    let newArr = Array();
    let removed = false;

    for (let i = 0; i < arr.length; i++) {
      // Do not copy value if it exists
      if (arr[i] !== value) {
        newArr.push(arr[i]);
      } else {
        // The element was not copied to the new array, which
        // means it was removed
        removed = true;
      }
    } // If the element was not removed, then it was not in the array
    // so add it


    if (!removed) {
      newArr.push(value);
    }

    return newArr;
  }
Toggles the value of an array. If a value is not contained in an array, the array returned will contain all the values of the original array including the value. If a value is contained in an array, the array returned will contain all the values of the original array excluding the value.

@static
@param {Array} arr An array.
@param {*} value A value to be toggled.
@returns {Array} The toggled array.