JSネスト関数呼び出しコンテキストの問題解決


 
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<script>
var stu ={
m: function(){
var self = this;
console.log(this === stu); // ==> true;
function f(){
// this
console.log(this === stu); // ==> false;
this this 。
console.log(self === stu); // ==> true;
}
f();

}

}
</script>
<body>

</body>
</html>