> For the complete documentation index, see [llms.txt](https://shenjunhong.gitbook.io/blog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shenjunhong.gitbook.io/blog/mian-shi/mei-zu-jing-li/2020.09.23.md).

# 2020.09.23

1. 请写出弹出值，并解释为什么

```js
alert(a)
a();
var a = 3;
function a(){
  alert(10)
}
alert(a)

a = 6;
a();
```

2. 请写出如下输出值， 并写出把注释掉的代码取消注释的值，并解释为什么

```js
  this.a = 20; 
  var test = {
      a: 40,
      init: ()=>{
        console.log(this.a)
      }
      go.prototype.a = 50;
      return go;
  }

  // var p = test.init()
  // p();
  new(test.init()) 
```

3.

```js
function C1(name){
  if(name) this.name = name;
}
function C2(name){
  this.name = name;
}

function C3(name){
  this.name = name || 'fe'
}

C1.prototype.name = 'yideng';
C2.prototype.name = 'lao';
C3.prototype.name = 'yuan';

console.log((new C1().name) + (new C2().name) + (new C3().name))
```

4. 写出输出值，并解释为什么

```js
function test(m){
  m : {v : 5}
}
var m = {k : 30}

test(m);
alert(m.v)
```

5. 请写出代码执行结果，并解释为什么

```js
function yideng(){
  console.log(1)
}
(function(){
  if(false){
    function yideng(){
      console.log(2)
    }
  }
})()
```

6. 请用一句话遍历变量a（禁止用for 已知var a = "abc"）
7.

```js
var length =12;
function init(){
  console.log(this.length)
}

var yideng = {
  length: 5,
  method: function(){
    fn();
    arguments[0]()
  }
}

8. 请在下面写出JavaScript 面向对象编程的混合式继承， 并写出ES6版本的继承。
```
