Exponent Goes Right To Left
luljs still works2 ** 3 ** 2 is 512, not 64.
In 2026: Still works. The ** operator is right-associative, the only arithmetic operator that is. So 2 ** 3 ** 2 means 2 ** (3 ** 2), which is 2 ** 9, which is 512. Reading it left to right as (2 ** 3) ** 2 would give 64.
Where it came from: Exponentiation is right-associative, unlike the other arithmetic operators, as MDN's exponentiation page states. MDN ↗
<script>
document.write('<p><code>2 ** 3 ** 2</code> is <b>' + (2 ** 3 ** 2) + '</b></p>');
document.write('<p><code>2 ** (3 ** 2)</code> is <b>' + (2 ** (3 ** 2)) + '</b> (what it means)</p>');
document.write('<p><code>(2 ** 3) ** 2</code> is <b>' + ((2 ** 3) ** 2) + '</b> (what it looks like)</p>');
</script>