var a;var code = " if(typeof(a) == 'undefined'){a={x:1};} "var b = eval(code); 最后b是{x:1},查了些资料,说是eval的返回值等于语句最后一个(有效的)子句的返回值