![What are unary operators? [1 day before exam]](/images/yt/hh/what-are-unary-operators-1-day-before-exam-0avbv.jpg)
What are unary operators? [1 day before exam]
This video tutorial shows you what unary operators are in programming laguages like python, java, c, c#, javascript and GameMaker language.
These operators are called unary because they are a shorthand way how to write instructions on only one variable or constant. Normally you would write something like this.
variable = variable + 1; Which is saying, add to the constant with the value of 1 to the value stored in the variable and then set that operation's stored result as a new value to the variable. But you can write that shorter like this: variable++;
This video covers the universal univery operators like ++,--, negative -, plus +, logical !, and tidle ~. There is also typeOf and void but not all languages use this and therefore I won't go into those here.