• An expression that subtracts the result of the second expression from the result of the first expression.

      var _ = ExpressionFactory;
    //Evaluates to 1.
    var number = _.subtract(_.number(3), _.number(2));
    //Evaluates to (1, 2, 3).
    var point = _.subtract(_.point({x: 3, y: 4, z: 5}), _.number(2));

    Type Parameters

    • T extends string | number | Vector3

    Parameters

    • left: Expression<T>

      The first expression to evaluate. Should result in a number, point or color.

    • right: Expression<number | T>

      The second expression to evaluate. Should result in the same type as left or a number.

    Returns Expression<T>

    An expression that subtracts the result of the second expression from the result of the first expression. Results in a number, point or color depending on the type of the operands. When a number is used with an other type, the operation is applied to the individual element values and the result is of the other type.