Stats

932 Contributors: 15 Tuesday, November 22, 2016
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap

Unary 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

Related Examples