当一个变量已经定义为一个数据类型时,可以改变他的数据类型吗

答案是不会的

x=1;

x.num=1

x+x.num=====>1+undefined=NaN

x='a';

x.num='b'

x+x.num====>'a'+undefined='aundefined';

论一个笔试题

原文地址:https://www.cnblogs.com/lwwen/p/9212067.html