What does js's exclamation point mean?

Sorry, a novice to js to ask a stupid question

recently, when I am learning vue, I often see that some people"s writing is full of exclamation marks

.

like this
@ click= "test=! test, sortID = "price""

if (! this.test) {
}

what do these exclamation points mean?

Mar.20,2021

this is a logical operator, not
for example: this.test = true
then the value of ! this.text is false

.
if (true) { // }
if (false) { // }

vue let's not look at the basics and read the es6 first


you will find that there are not only "exclamation marks" but also "question marks", "dollar signs" and so on


! the logic no in the Boolean operator first converts its Operand to a Boolean value (with certain conversion rules, you can consult the relevant data), and then inverts the Boolean value.

let a = true;
console.log(!a);//false

let b = '';
console.log(!b);//true

let c = 123;
console.log(!c);//false

in addition to logic not ! , there are logic and & , logic or |


No (reverse).


suggest taking a good look at the basics of js. How can some arithmetic symbols be. For example! & & |


means logic inversion, which means you haven't read through the basics of javascript language programming at least once.

Menu