第一個(gè)使用object構(gòu)造函數(shù),第二個(gè)使用function構(gòu)造函數(shù),使用typeof()檢測(cè)到他們都是object類型,他們有什么區(qū)別呢?var age = new Object;
age.tom = '20';
alert(age.tom);function age(){
age.tom = '20';
};var a = new age();
alert(age.tom);
下面兩種構(gòu)造函數(shù)在實(shí)質(zhì)上有什么區(qū)別呢?
手掌心
2018-08-09 11:10:50