<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
<script>
var name='小王',age=17;
var obj={
name:"小张",
objAge:this.age,
myFun:function(){
console.log(this.name+"----"+this.age)
}
}
var db={
name:'德玛',
age:99
}
//call分别接受参数
//apply方法接受数组
//bind 以创建一个新的函数的形式
console.log(obj.objAge);
obj.myFun.bind(demo)();
obj.myFun.apply();
obj.myFun.call();
</script>
</html>