1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| <script type="text/javascript"> var ageInt = 10; var ob = { name:"zs", age:ageInt } var age = 10; var ob2 = {age:age} dw(ob2.age); var ob1={age}; dw(ob1.age); var ob3={ age:20, showAge:function(){ alert(this.age); }, showAgeX(){ alert(this.age); }, showAgeXX:()=>{ alert(this.age); } } ob3.showAge(); ob3.showAgeX(); ob3.showAgeXX(); function dw(param){ document.write(param); document.write("<br />") } </script>
|