NP
Size: a a a
NP
IN
NP
> let it = false
undefined
> const func = () => {it = !it}
undefined
> func()
undefined
> it
true
> func()
undefined
> it
false
> func()
undefined
> it
true
>
NP
M
M
Q
let isBool = falseможет так тебе подойдет?
function toggleBool(value) {
return !value
}
console.log(isBool) // false
isBool = toggleBool(isBool)
console.log(isBool) // true
NP
let isBool = falseможет так тебе подойдет?
function toggleBool(value) {
return !value
}
console.log(isBool) // false
isBool = toggleBool(isBool)
console.log(isBool) // true
NP
IN
Q
M
IN
M
NP
NP
NP
M
NP
M