3👍
In JS, as well as in most of programming languages, single “=” operator is used to assign one value to another. Thus, doing attachRed = !attachRed
you’re simply reassigning the value of attachRed
. When you reassign the value of any variable, the return is new value. If you want to compare two values, use either ==
or ===
.
2👍
The !
operator means “not”. So if the value of attachRed
is true
, then !attachRed
means “not true” (which of course means “false”). If the value of attachRed
is false
, then !attachRed
means “not false” – so, “true”.
- [Vuejs]-Vue.js not working in one of my cshtml pages
- [Vuejs]-How can I make my Vue for-loop generated buttons cover the entire area of my div?
Source:stackexchange.com