我正在尝试通过 IsFormDisplayed 函数切换我的布尔值
I am trying to toggle my Boolean by IsFormDisplayed function
嘿,我正在从 调用 IsFormDisplayed 函数。我希望每次调用此函数时都能在 true 和 false 之间切换。你能告诉我哪里做错了吗?
我试过创建 if else 函数。但它保持不变。
我的函数是这样的..这每次都给我错误的值
let FormCondition = true;
FormCondition = !FormCondition;
console.log(FormCondition);
},```
no error massage[enter image description here][1]
[1]: https://i.stack.imgur.com/HE9oQ.png
let formCondition = true;
function toggle() {
formCondition = !formCondition
console.log(formCondition)
}
toggle()
toggle()
嘿,我正在从 调用 IsFormDisplayed 函数。我希望每次调用此函数时都能在 true 和 false 之间切换。你能告诉我哪里做错了吗?
我试过创建 if else 函数。但它保持不变。
我的函数是这样的..这每次都给我错误的值
let FormCondition = true;
FormCondition = !FormCondition;
console.log(FormCondition);
},```
no error massage[enter image description here][1]
[1]: https://i.stack.imgur.com/HE9oQ.png
let formCondition = true;
function toggle() {
formCondition = !formCondition
console.log(formCondition)
}
toggle()
toggle()