<script type="text/javascript">
function foo() {
if( this=== window) {
console.log(1);
}
}
foo.boo=function() {
if( this=== foo) {
console.log(2);
}
if( this=== window) {
console.log(3);
}
};
foo();
foo.boo();
foo.boo.apply(window);
</script>
function foo() {
if( this=== window) {
console.log(1);
}
}
foo.boo=function() {
if( this=== foo) {
console.log(2);
}
if( this=== window) {
console.log(3);
}
};
foo();
foo.boo();
foo.boo.apply(window);
</script>