Type in the words(s) to search for:

    Mark results
      Userbooster Help

      -= (Subtraction Equality)

      The substraction equality operator:

      • Performs the subtraction if the first operand is of boolean, numeric, floating or date-time type. It throws an exception when the second operand is of not appropriate type.
      • Performs the substring subtraction if the first operand is a string or an exception string. It throws an exception when the second operand cannot be represented as a string.
      • Performs the subtraction of one array from another if both operands are arrays.
      • Removes the value from the array if the first operand is an array and second operand is not an array.
      • Throws an exception otherwise.

      Example

      var i = 1;
      i -= 2;