Loading workspace environment...
Perform arithmetic, comparisons, and logical operations on your data.
a + b, a - b, a * b, a / bStandard arithmetic operators.a % bModulo operator: returns remainder of division.a === b, a !== bStrict equality and inequality comparisons.a && b, a || b, !aLogical AND, logical OR, and logical NOT.const totalItems = 17;
const itemsPerBox = 5;
const fullBoxes = Math.floor(totalItems / itemsPerBox);
const leftoverItems = totalItems % itemsPerBox;
console.log("Full boxes packed:", fullBoxes);
console.log("Leftover items (modulo %):", leftoverItems);
const hasValidAge = 18 >= 18; // true
const hasPermission = true;
const canEnter = hasValidAge && hasPermission;
console.log("Can enter venue:", canEnter);Full boxes packed: 3
Leftover items (modulo %): 2
Can enter venue: trueconst leftoverItems = totalItems % itemsPerBox;Calculates the remainder 17 % 5 = 2.const canEnter = hasValidAge && hasPermission;Both sides are true, yielding true.if (x = 5) { ... } // Assignment instead of comparison!if (x === 5) { ... } // Triple equals for comparisonArchitectural Explanation: A single = assigns a value. Triple === compares two values for equality.
Given a number, write a program that uses modulo (%) to determine if the number is even. Log true if even, false if odd.