JavaScriptUnary Operators

Syntax

  • void expression; // Evaluates expression and discards return value
  • +expression; // Attempt to convert expression to a number
  • delete object.property; // Delete object's property
  • delete object["property"]; // Delete object's property
  • typeof operand; // Returns type of operand
  • ~expression; // Perform NOT operation on each bit of expression
  • !expression; // Perform logical negation on expression
  • -expression; // Negate expression after attempting conversion to number