普通函数:
//普通函数
function f1() {
console.log("文能提笔控萝莉");
}
f1();
构造函数:
//构造函数---通过new 来调用,创建对象
function F1() {
console.log("我是构造函数,我骄傲");
}
var f=new F1();
对象的方式:
//对象的方法
function Person() {
this.play=function () {
console.log("玩代码");
};
}
var per=new Person();
per.play();