In plain words
Operators are the symbols that do arithmetic, compare two values or combine conditions, and one wrong character can flip what your app decides.
Where you see it
Any line with an if in it leans on operators. In Guildhall, user.role === "admin" decides who sees the delete button, and && or || decides whether both checks must pass or only one.
What goes wrong
- One equals sign where three were meant
= stores a value and === compares. Inside an if, a single = sets the role and makes the check pass for everyone.
if (user.role = "admin") { showAdminPanel(); } - Using == instead of ===
== converts types before comparing, so 0 == "" is true. === checks the type as well, which is nearly always what you want.
- Swapping && and ||
"Admin and author" and "admin or author" are different rules. Two characters decide whether you lock everyone out or let everyone in.
What to tell your agent
Quick check
Sign in to earn +10 XP for itEvery Guildhall member can suddenly see the admin panel. Which line is the likely culprit?