- var name = "The Window";
- var obj = {
- name: "My Object",
- getNameFunc: function() {
- return function() {
- return this.name;
- };
- }
- };
- console.log( obj.getNameFunc()() );
- //该片段来自于http://www.codesnippet.cn/detail/181120137252.html
来源: http://www.codesnippet.cn/detail/181120137252.html