Correction status:qualified
Teacher's comments:这些都是最基本的知识点, 想深入学习可以参考: MDN
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>0710作业</title> </head> <body> <script> var createobj =function () { this.domin = "baidu.com"; this.get = function (value) { var site = '百度搜索引擎'; return site + value; }; }; var obj1 = new createobj(); console.log(obj1.get(obj1.domin)); //访问内部成员 var obj2 = new createobj(); console.log(obj1.get(obj2.domin)); Createobj.prototype.email ='www.baidu.com'; Createobj.prototypi.hello = function() { return'hello baidu'; } </script> </body> </html>
点击 "运行实例" 按钮查看在线实例