Because document.write is trying to evaluate the expression you give it.
is not a vaild expression because it cannot be evaluated, you have an equals sign indicating an equation but nothing after it, what does it mean?
is a valid expression that evaluates to 5 as true converts to 1, false to 0 and multiplication has a higher priority than addition giving (1 * 5) + (0 * 7).