Codedamn Javascript Logical Question