Special Operators

Special operators in JavaScript are used to perform specific tasks. The table below presents the special operators and the tasks they perform.

OperatorSymbolPurpose
Conditional?:Often used as a short if/else type of statement. A condition is placed before the ? and a value is placed on each side of the colon.
Comma,Evaluates the statement on both sides of the operator and returns the value of the second statement.
DeletedeleteUsed to delete an object, a property, or an element in an array.
IninReturns true if a property is in a specific object.
InstanceofinstanceofReturns true if an object is of a specified object type.
NewnewCreates an instance of an object.
ThisthisRefers to the current object.
TypeoftypeofReturns a string that tells you the type of the value being evaluated.
VoidvoidAllows an expression to be evaluated without returning a value.

Leave a Reply