how to negate a boolena variable javascript 1

how to negate a boolena variable javascript

isAllowed = !isAllowed

Here is what the above code is Doing:
1. We create a variable called isAllowed and set it to True.
2. We create a function called toggleIsAllowed.
3. Inside the function, we set isAllowed to the opposite of what it is.
4. We call the function.
5. We print out isAllowed to see what it is.

Similar Posts