今天学习了JavaScript语法基础
代码:
实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script> function Cperson(name,age){ var p=new Object(); p.name=name; p.age=age; return p; } function Person(name,age) { this.name=name; this.age=age; } function Person() { Person.prototype.name='tom'; Person.prototype.age=18; } </script> </head> <body> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例