Learn Intermediate Algorithmic Thinking by Building a Dice Game - Step 11

Tell us what’s happening:

rulesBtn.addEventListener(“click”, () => {
console.log(!isModalShowing & !isModalShowing);
});

not understanding how to pass the (!)

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

rulesBtn.addEventListener("click", () => {
  console.log(!isModalShowing & !isModalShowing);
});

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3.1 Safari/605.1.15

Challenge Information:

Learn Intermediate Algorithmic Thinking by Building a Dice Game - Step 11

Your goal for this step is to reassign isModalShowing to its inverted value. Using the logical not operator (!) changes a true value to false and vice versa.

Some examples:

Happy coding. :slight_smile:

!someVariable is an expression that will evaluate to a value (the negated value).

It doesn’t change the value contained in the variable, but the value the expression returns can be assigned back to the variable.

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

thank you I got it, wasn’t understanding the expression of how to use it. With your explanation it was clear