Jacklovely

导航

 

说明(2017.3.30):

1. 最简单的继承方式,混入mix

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>Document</title>
 6 </head>
 7 <body>
 8 <script type="text/javascript">
 9     // 最简单的继承方式,混入mix
10     var o1 = {name:"xxx"};
11     var o2 = {age:"19"};
12     function mix(o1,o2){
13         for(var i in o2){
14             o1[i] = o2[i];
15         }
16     }
17     mix(o1,o2);
18     console.log(o1);
19 </script>
20 </body>
21 </html>

 

posted on 2017-03-30 14:45  Jacklovely  阅读(293)  评论(0编辑  收藏  举报