UnaryOperator(exp)

Creates a UnaryOperation from the given argument.

If the argument is not an expression, it will be wrapped in an appropriate literal.

  • A (positive) number will be encapsulated in a Number Literal,
  • A string will be encapsulated in a Variable Literal.

Source

UnaryOperator(exp) {
  this.exp = _toExpression(exp);
}