JavaScript Unary Operators Overview


Unary operators are operators with only one operand. Unary operators are more efficient than standard JavaScript function calls. Additionally, unary operators can not be overridden and therefore their functionality is guaranteed.

The following unary operators are available:

deleteThe delete operator deletes a property from an object.example
voidThe void operator discards an expression's return value.example
typeofThe typeof operator determines the type of a given object.example
+The unary plus operator converts its operand to Number type.example
-The unary negation operator converts its operand to Number, then negates it.example
~Bitwise NOT operator.example
!Logical NOT operator.example