码迷,mamicode.com
首页 > Web开发 > 详细

js 对象

时间:2017-10-22 11:13:39      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:var   对象   new   on()   this   nbsp   function   name   fun   



    function Person() {
        
    }

    var per = new Person();
    per.Name = "pan";
    per.Age = 10;
    alert(per.Name);
    alert(per.Age);


 


    function Person(name,age) {
        this.Name = name;
        this.Age = age;
    }

    var per = new Person("lo",40);
    alert(per.Name);
    alert(per.Age);

js 对象

标签:var   对象   new   on()   this   nbsp   function   name   fun   

原文地址:http://www.cnblogs.com/rockywood/p/7707772.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!