You should have seen 1, 2, 1, 2. Javascript does not have block scoping! Unless you use the 1.7 "let" construct, which seems evil.