Mitch,
The form values are of string type and hence y is assigned a string when you directly use those variables. But when you try to multiply the same by 1, JavaScript runtime converts those values into numbers before multiplying and the resulting value will also be a number. That is the reason why it works fine.
—
Sunil Urs