javascript-高级进阶篇(2)

5/27/2020

# 三、函数的进阶

1.函数的定义方式
var fn = new Function('参数1','参数2'...,'函数体')

Function 里面参数都必须是字符串格式
第三种方式执行效率低,也不方便书写,因此较少使用
所有函数都是 Function 的实例(对象)
函数也属于对象
万物皆对象


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>1.函数的定义方式</title>
</head>
<body>
    <script>
    //1.自定义函数(命名函数)
    function fn(){}
    //2.函数表达式(匿名函数)
    var fun = function(){}
    //3.利用 new Function('参数1','参数2','函数体')
    var f = new Function('a','b','console.log(a+b)');
    f(21,32);
    //4.所有函数都是Function 的实例(对象)
    console.dir(f);
    //5.函数也属于对象
    console.log(f instanceof Object);
    </script>
</body>
</html>

2.函数的调用方式
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>2.函数的调用方式</title>
</head>
<body>
    <script>
    //函数的调用方式
    //1.普通函数
    function fn(){
        console.log('普通函数');
    }
    // fn();fn.call();
    //2.对象的方法
    var o ={
        sayHi:function(){
            console.log('对象的方法');
        }
    }
    o.sayHi();
    //3.构造函数
    function Star(){}
    new Star();
    //4.绑定事件函数
    // btn.onclick = function(){};//点击了按钮就可以调用这个函数
    //5.定时器函数
    setInterval(function(){},1000);//这个函数是定时器自动1秒钟调用1次
    //6.立即执行函数
    (function(){
        console.log('立即执行函数');
    }())
    //立即执行函数是自动调用
    </script>
</body>
</html>

3.函数内部的this指向
这些this 的指向,是当我们调用函数的时候确定的。调用方式的不同决定了this 的指向不同一般指向我们的调用者:

调用方式	this指向
普通函数调用	window
构造函数调用	实例对象 原型对象里面的方法指向实例对象
对象方法调用	改方法所属对象
事件绑定方法	绑定事件对象
定时器函数	window
立即执行函数	window
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>3.函数内部的this指向</title>
</head>
<body>
    <button>点击</button>
    <script>
    //函数的调用方式
    //1.普通函数 this 指向window
    function fn(){
        console.log('普通函数'+ this);
    }
    // fn();
    fn.call();
    //2.对象的方法 this指向的是o
    var o ={
        sayHi:function(){
            console.log('对象的方法',this);
        }
    }
    o.sayHi();
    //3.构造函数 this指向ldh这个实例对象 原型对象里面的 this 指向的也是 ldh这个实例对象
    function Star(){}
    Star.prototype.sing = function(){}
    new Star();
    //4.绑定事件函数 指向的是函数的调用者 btn这个按钮对象
    var btn  = document.querySelector('button');
    btn.onclick = function(){
        console.log('绑定事件函数', this);
    };//点击了按钮就可以调用这个函数
    //5.定时器函数 this指向的也是window
    setInterval(function(){ 
        console.log('定时器函数', this);
    },1000);//这个函数是定时器自动1秒钟调用1次
    //6.立即执行函数  this指向的也是window
    (function(){ 
        console.log('立即执行函数', this);
    }())
    //立即执行函数是自动调用
    </script>
</body>
</html>
JavaScript为我们专门提供了一些函数方法来帮我们更优雅的处理函数内部this得到指向问题,常用的有 bind()、call()、apply() 三种方法。

4.call方法及其应用
call()方法调用一个对象。简单理解为调用函数的方式,但是它可以改变函数的this 指向。
fun.call(thisArg, arg1, arg2, ...)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>4.call方法及其应用</title>
</head>
<body>
    <script>
        //call()
        var o = {
            uname:'angle'
        }
        function fn(a,b){
            console.log(this);
            console.log(a+b);
        }
        fn.call(o,1,22);
        //call 第一个可以调用函数 第二个可以改变函数内的this指向
        //call的主要作用可以实现继承
        function Father(uname,age,sex){
            this.uname = uname;
            this.age = age;
            this.sex = sex;
        }
        
        function Son(uname,age,sex){
            Father.call(this,uname,age,sex);
        }
 
        var son = new Son('离歌笑',20,'男');
        console.log(son);
    </script>
</body>
</html>

5.apply方法及其应用
apply() 方法调用一个函数。简单理解为调用函数的方法,但是它可以改变函数的 this 指向
fun.apply(thisArg, [argsArray])

    thisArg: 在fun函数运行时指定的this值
    argsArray: 传递的值,必须包含在数组里面
    返回就是函数的返回值,因为他就是调用函数

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>5.apply方法及其应用</title>
</head>
<body>
    <script>
    //改变函数内this指向 js提供了三种方法 call() apply() bind()
    //2.apply() 应用 运用的意思
    var o = {
        uname:'离歌笑',
        age:'20'
    }
    function fn(arr){
        console.log(this);
        console.log(arr);//'pink'
    }
    fn.apply(o,['orange']);
    //1.也是调用函数 第二个可以改变函数内部this指向
    //2.但是他的参数必须是数组(伪数组)
    //3.apply的主要应用 比如说我们可以利用apply借助于数学内置对象求最大值
    //Math.max()
    var arr = [1,66,310,99,4];
    // var max = Math.max.apply(null,arr);
    var max = Math.max.apply(Math,arr);
    var min = Math.min.apply(Math,arr);
    console.log(max,this,min);
    </script>
</body>
</html>

6.bind方法基本使用
bind() 方法不会调用函数,但是能改变函数内部this指向
fun.bind(thisArg, arg1, arg2, ...)

    thisArg: 在fun函数运行时指定的this值
    arg1, arg2: 传递的其他参数
    返回由指定的 this 值和初始化参数改造的原函数拷贝

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>6.bind方法基本使用</title>
</head>
<body>
    <button>点击</button>
    <button>点击</button>
    <button>点击</button>
    <script>
     //改变函数内this指向 js提供了三种方法 call() apply() bind()
     //3.bind() 绑定 捆绑的意思
     var o = {
         name:'andy'
     }
     function fn(a,b){
         console.log(this);
         console.log(a+b);
     }
 
     var f =fn.bind(o,1,2);
     f();
     //1.不会调用原来的函数 可以改变原来函数内部的this指向
     //2.返回的是原函数改变this之后产生的新函数
     //3.如果有的函数我们不需要立即调用,但是又想改变这个函数内部的this指向,此时用bind
     //4.我们有一个按钮,当我们点击了之后,就禁用这个按钮,3秒钟之后开启这个按钮
    //  var btn = document.querySelector("button");
    //  btn.onclick = function(){
    //      this.disabled = true;//这个this指向的是btn这个按钮
    //      var that =this;
    //     setInterval(function(){
    //         // that.disabled = false;//定时器函数里面的this指向的是window
    //         this.disabled = false;//此时定时器函数里面this指向的是btn
    //     }.bind(this),3000);//这个this指向的是btn这个对象
    //  }
 
    var btns = document.querySelectorAll('button');
    // for(var i=0;i<btns.length;i++)
    // {
    //     btns[i].onclick =function(){
    //         this.disabled = true;
    //         setInterval(function(){
    //             this.disabled = false;
    //         }.bind(this),2000)
    //     }
    // }
 
 
    btns.forEach(function(value,index){
       btns[index].onclick =function(){
        this.disabled = true;
            setInterval(function(){
                this.disabled = false;
            }.bind(this),2000)
       }
    })
    </script>
</body>
</html>

7.bind应用面向对象tab栏
// var that;
class Tab{
    constructor(id){
        // that = this;
        this.main = document.querySelector(id);
        this.add = document.querySelector(".tabadd");
        this.ul =document.querySelector(".fisrstnav ul:first-child");
        this.fsection = document.querySelector('.tabscon');
        this.init();
    }
    init(){
        this.updateNode();
        for(var i=0;i<this.lis.length;i++)
        {
            this.lis[i].index = i;
            this.lis[i].onclick = this.toggleTab.bind(this.lis[i],this);
            this.remove[i].onclick = this.removeTab.bind(this.remove[i],this);
            this.spans[i].ondblclick = this.editTab;
            this.sections[i].ondblclick = this.editTab;
        }
        this.add.onclick = this.addTab.bind(this.add,this);
    }
    //获取所有的小li和section
    updateNode(){
        this.lis = document.querySelectorAll('li');
        this.sections = document.querySelectorAll('section');
        this.remove = document.querySelectorAll(".icon-guanbi");
        this.spans = document.querySelectorAll('.fisrstnav li span:first-child');
    }
    //1.切换功能
    toggleTab(that){
        that.clearClass();
        this.className="liactive";
        that.sections[this.index].className="conactive";
    }
    clearClass(){
        for(var i=0;i<this.lis.length;i++)
        {
            this.lis[i].className = "";
            this.sections[i].className ="";
        }
    }
    getRandom(min,max)
    {
        return Math.floor(Math.random()*(max-min+1))+min;
    } 
    //2.添加功能
    addTab(that){
        that.clearClass();
        var random = that.getRandom(1,500);
        var li = "<li  class='liactive'><span>测试"+random+"</span><span class='iconfont icon-guanbi'></span></li>";
        var section = "<section class='conactive'>测试"+random+"</section>";
        // beforebegin: 元素自身的前面。
        // afterbegin: 插入元素内部的第一个子节点之前。
        // beforeend: 插入元素内部的最后一个子节点之后。
        // afterend: 元素自身的后面。
        // text是要被解析为HTML或XML,并插入到DOM树中的字符串。
        that.ul.insertAdjacentHTML('beforeend',li);
        that.fsection.insertAdjacentHTML('beforeend',section);
        that.init();
    }
    //3.删除功能
    removeTab(that,e){
        //阻止冒泡(点击切换标签)
        e.stopPropagation();
        var index = this.parentNode.index;
        that.lis[index].remove();
        that.sections[index].remove();
        if(document.querySelector('liactive')) return
        index --;
        that.lis[index] && that.lis[index].click();
        that.init();
    }
    //4.修改功能
    editTab(){
        var str = this.innerHTML;
        window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
        this.innerHTML ="<input type='text'>";
        var input = this.children[0];
        input.value =str;
        input.select();
        input.onblur = function(){
            this.parentNode.innerHTML = this.value;
        }
        input.onkeyup = function(e){
            if(e.keyCode === 13)
            {
                this.blur();
            }
        }
    }
}
new Tab('#tab');

8.call和apply以及bind总结
相同点:

    都可以改变函数内部的this指向。

区别点:

    call 和 apply 会调用函数,并且改变函数内部this指向
    call 和 apply 传递的参数不一样,call 传递参数aru1,aru2…形式 apply 必须数组形式[arg]
    bind 不会调用函数,可以改变函数内部this指向

主要应用场景:

    call 经常做继承
    apply 经常跟数组有关系,比如借助数学对象实现数组最大值最小值
    bind 不调用函数,但是还想改变this指向,比如改变定时器内部的this指向

9.什么是严格模式以及如何开启严格模块
JavaScript除了提供正常模式外,还提供了严格模式(strict mode)。 ES5的严格模式是采用具有限制性

JavaScript变体的一种方法,即在严格的条件下运行js代码

严格模式在IE10以上版本的浏览器才会被支持,旧版本浏览器中会被忽略

严格模式对正常的 JavaScript语义做了一些更改:

    消除了 JavaScript语法的一些不合理、不严谨之处,减少了一些怪异的行为。
    消除代码运行的一些不安全之处,保证代码运行的安全。
    提高编译器效率,增加运行速度。
    禁用了在ECMAScript 的未来版本中可能会定义的一些语法,为未来新版本的 JavaScript做好铺垫。比如一些保留字如:class,enum,export,extends,import,super 不能做变量名

开启严格模式

​ 严格模式可以应用到整个脚本或个别函数中。因此在使用时,我们可以将严格模式分为“为脚本开启严格模式”和“为函数开启严格模式”两种情况

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>10.什么是严格模式以及如何开启严格模块</title>
</head>
<body>
    <!-- 为整个脚本(script)开启严格模式 -->
    <script>
        'use strict';
        //下面的js代码就会按照严格模式执行代码
    </script>
    <script>
        (function(){
            'use strict';
        })()
    </script>
    <!-- 为某个函数开启严格模式 -->
    <script>
        //此时只是给fn函数开启严格模式
        function fn(){
            'use strict';
        }
        function fun(){
            //里面的还是按照普通模式执行
        }
    </script>
</body>
</html>

 10.严格模式的变化
    严格模式对 JavaScript的语法和行为,都做了一些改变。

    变量规定
    (1) 在正常模式中,如果一个变量没有声明就赋值,默认是全局变量。严格模式禁止这种用法,变量都必须先用 var 命令声明,然后再使用。
    (2) 严禁删除已经声明的变量。列如,delete x; 语法是错误的
    严格模式下 this 指向问题
    (1) 以前在全局作用域函数中的 this 指向 window 对象。
    (2) 严格模式下全局作用域中函数中的this 是 undefined
    (3) 以前构造函数时不加new也可以调用普通函数,this指向全局对象
    (4) 严格模式下,如果 构造函数不加new调用,this 会报错.
    (5) new 实例化的构造函数指向创建的对象实例。
    (6) 定时器 this 还是指向 window
    (7) 事件、对象还是指向调用者
    函数变化
    (1) 函数不能有重名的参数。
    (2) 函数必须声明在顶级,新版本的 JavaScript会引入 “块级作用域” ( ES6 中已引入)。为了与新版本接轨,不允许在非函数的代码块内声明函数。
    更多严格模式要求参考:https://developer.mozilla.org/zh-CN/docs/Web/javaScript/Reference/Strict_mode

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>11.严格模式的变化</title>
</head>
<body>
    <script>
        'use strict';
        //1.我们的变量名必须先声明再使用
        // num =10;
        // console.log(num);
        //2.我们不能随意删除已经声明好的变量
        // delete num;
        //3.严格模式下全局作用域中函数中的this是undefined
        // function fn(){
        //     console.log(this);//undefined
        // }
        // fn();
        //4.严格模式下,如果构造函数不加new调用,this指向的是undefined 如果给它赋值则会报错
        // function Star(){
        //     this.sex = '男';
        // }
        // var ldh = new Star();
        // console.log(ldh.sex);
        //5.定时器 this还是指向window
        // setTimeout(function(){
        //     console.log(this);
        // },2000)
        //6.严格模式下函数里面的参数不允许有重名
        function fn(a,a)
        {
            console.log(a+a);
        }
        fn(1,6);
    </script>
</body>
</html>

11.高阶函数
高阶函数是对其他函数进行操作的函数,它接收函数作为参数或将函数作为返回值输出。

函数也是一种数据类型,同样可以作为参数,传递给另一个参数使用,最典型的就是作为回调函数。

function fn(callback){                  
     callback&&callback();                   
}                                       
fn(function(){alert('hi')})      
 
function fn(){
    return function(){}
}
fn();
                 
 此时fn 就是一个高阶函数

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>12.高阶函数</title>
    <script src="jquery.min.js"></script>
    <style>
    div{
        position: absolute;
        width:100px;
        height: 100px;
        background-color: antiquewhite;
    }
    </style>
</head>
<body>
    <div></div>
    <script>
        //高阶函数 函数可以作为参数传递
        function fn(a,b,callback){
            console.log(a+b);
            callback && callback();
        }    
        fn(12,3,function(){
            console.log('我是最后调用的');
        })
        $("div").animate({left:500},function(){
            $('div').css('backgroundColor','blue');
        })
    </script>
</body>
</html>

12.什么是闭包
变量作用域
变量根据作用域的不同分为两种:全局变量和局部变量。
函数内部可以使用全局变量。
函数外部不可以使用局部变量。
当函数执行完毕,本作用域内的局部变量会销毁
闭包(closure) 指有权访问另一个函数作用域中变量的函数。 — JavaScript高级程序设计
简单理解就是,一个作用域可以访问另外一个函数内部的局部变量
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>13.什么是闭包</title>
</head>
<body>
    <script>
        //闭包(closure)指有权访问另一个函数作用域中变量的函数。
        //闭包:我们fun这个函数作用域 访问量另外一个函数 fn里面的局部变量 num
        function fn(){
            var num = 200;
            function fun(){
                console.log(num);
            }
            fun();
        }
        fn();
    </script>
</body>
</html>

13.闭包的作用
闭包(closure)指有权访问另一个函数作用域中变量的函数。

我们fn外面的作用域可以访问fn内部的局部变量

闭包的主要作用:延伸了变量的作用范围

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>13.什么是闭包</title>
</head>
<body>
    <script>
        //闭包(closure)指有权访问另一个函数作用域中变量的函数。
        //闭包:我们fun这个函数作用域 访问量另外一个函数 fn里面的局部变量 num
        //我们fn外面的作用域可以访问fn内部的局部变量
        //闭包的主要作用:延伸了变量的作用范围
        function fn(){
            var num = 200;
            // function fun(){
            //     console.log(num);
            // }
            // return fun;
            return function(){
                console.log(num);
            }
        }
        var f = fn();
        f();
        //类似于
        //var f = function(){console.log(200);}
        //var f = function fun(){ console.log(200);}
    </script>
</body>
</html>

14.闭包应用-点击li打印当前索引号
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>14.闭包应用-点击li打印当前索引号</title>
</head>
<body>
    <ul class="nav">
        <li>肠粉</li>
        <li>牛肉粿条</li>
        <li>虎皮蛋糕</li>
        <li>酸菜鱼</li>
    </ul>
    <script type="text/javascript">
        var lis = document.querySelector('.nav').querySelectorAll("li");
        for(var i =0;i<lis.length;i++)
        {
            lis[i].index = i;
            lis[i].onclick = function(){
                console.log(this.index);
            }
        }
        // lis.forEach(function(value,index){
        //     lis[index].onclick = function(){
        //         console.log(index);
        //     }
        // })
        //2.利用闭包的方式得到当前小li 的索引号
        for(vari =0;i<lis.length;i++)
        {
            //利用for循环创建了4个立即执行函数
            //立即执行函数也称为小闭包因为立即执行函数里面的任何一个函数都可以使用它的i变量
            (function(i){
                lis[i].onclick =function(){
                    console.log(i);
                }
            })(i)
        }
    </script>
</body>
</html>

15.闭包应用-3秒钟之后打印li内容
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>15.闭包应用-3秒钟之后打印li内容</title>
</head>
<body>
    <ul class="nav">
        <li>肠粉</li>
        <li>牛肉粿条</li>
        <li>虎皮蛋糕</li>
        <li>酸菜鱼</li>
    </ul>
    <script type="text/javascript">
        //闭包应用-3秒钟之后,打印所有li元素的内容
        var lis = document.querySelector('.nav').querySelectorAll("li");
        for(var i=0;i<lis.length;i++)
        {
           (function(i){
                setTimeout(function(){
                    console.log(lis[i].innerHTML);
                },3000)
           })(i)
        }
    </script>
</body>
</html>

16.闭包应用-计算打车价格
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>16.闭包应用-计算打车价格</title>
</head>
<body>
    <script>
    //闭包应用-计算打车价格
    //打车起步价13(3公里内),之后每多一公里增加5块钱,用户输入公里数就可以计算打车价格
    //如果有拥堵情况,总价格多收取10块钱拥堵费
    var car = (function(){
        var start = 13;//起步价 局部变量
        var total = 0;//总价 局部变量
        return {
            //正常的总价
            price:function(n){
                if(n<=3)
                {
                    total = start;
                }
                else{
                    total = start+(n - 3) * 5
                }
                return total;
            },
            //拥堵的价格
            yd:function(flag){
                return flag ? total + 10 : total;
            }
        }
    })()
 
    // function fn(){
    //     var start = 13;//起步价 局部变量
    //     var total = 0;//总价 局部变量
    //     return {
    //         //正常的总价
    //         price:function(n){
    //             if(n<=3)
    //             {
    //                 total = start;
    //             }
    //             else{
    //                 total = start+(n - 3) * 5
    //             }
    //             return total;
    //         },
    //         //拥堵的价格
    //         yd:function(flag){
    //             return flag ? total + 10 : total;
    //         }
    //     }
    // }
    // var car = fn();
 
    console.log(car.price(5));//23
    console.log(car.yd(true));//33
    
    console.log(car.price(1));//13
    console.log(car.yd(false));//13
    </script>
</body>
</html>
闭包是什么?
闭包是一个函数(一个作用域可以访问另外一个函数的局部变量)
闭包的作用是什么?
延伸变量的作用范围

19.什么是递归函数
如果一个函数在内部可以调用其本身,那么这个函数就是递归函数。
简单理解:函数内部自己调用自己,这个函数就是递归函数
递归函数的作用和循环效果一样
由于递归很容易发生 “栈溢出” 错误(stack overflow), 所以必须要加退出条件 return
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>18.什么是递归函数</title>
</head>
<body>
    <script>
    //递归函数:函数内部自己调用自己,这个函数就是递归函数
    var num = 1;
    function fn(){
        console.log('到6停止');
        if(num == 6)
        {
            return ;//递归里面必须加退出条件
        }
        num ++;
        fn();
    }
    fn();
    </script>
</body>
</html>

20.利用递归求阶乘
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>19.利用递归求阶乘</title>
</head>
<body>
    <script>
    //利用递归函数求1~n的阶乘 1 * 2 * 3 * 4 * ..n
    function fn(n)
    {
        if(n==1)
        {
            return 1;
        }
        return n * fn(n-1);
    }
    console.log(fn(4));
    </script>
</body>
</html>
21.利用递归求斐波那契数列
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>20.利用递归求斐波那契数列</title>
</head>
<body>
    <script>
        // 利用递归函数求斐波那契数列(兔子序列)  1、1、2、3、5、8、13、21...
        // 用户输入一个数字 n 就可以求出 这个数字对应的兔子序列值
        // 我们只需要知道用户输入的n 的前面两项(n-1 n-2)就可以计算出n 对应的序列值
        function fn(n){
            if(n===2|| n ===1)
            {
                return 1;
            }
            return fn(n-1) + fn(n-2);
        }
        console.log(fn(6));
    </script>
</body>
</html>

22.利用递归遍历数据
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>21.利用递归遍历数据</title>
</head>
<body>
    <script>
        var data = [{
            id:1,
            name:'家电',
            goods:[{
                id:11,
                gname:'冰箱',
                goods:[{
                    id:111,
                    gname:'海尔',
                },
                {
                    id:112,
                    gname:'美的'
                }
            ]
            },{
                id:12,
                gname:'洗衣机'
            },]
        },{
            id:2,
            name:'服饰',
        }]
        //我们想要做输入id号,就可以返回的数据对象
        //1.利用forEach 去遍历里面的每一个对象
        function getID(json,id){
        var o = {};
            json.forEach(function(item){
                // console.log(id,item.id);
                if(item.id == id)
                {
                   o = item;
                    //我们想要得到里层的数据
                    //里面应该有goods这个数组并且数组的长度不为0
                }
                else if(item.goods && item.goods.length>0){
                    // console.log(item.goods,id);
                    o = getID(item.goods,id);
                }
            })
            return o;
        }
    //    console.log( getID(data,1));
       
       console.log( getID(data,11));
    //    console.log( getID(data,2));
    //    console.log( getID(data,12));
    //    console.log( getID(data,112));
    //    console.log( getID(data,1232));
    </script>
</body>
</html>

23.浅拷贝
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>23.浅拷贝</title>
</head>
<body>
    <script>
        //浅拷贝只是拷贝一层,更深层次对象级别的值拷贝引用
        //深拷贝拷贝多层,每一级别的数据都会拷贝。
        var obj = {
            id:1,
            name:'angle',
            msg:{
                age:18
            }
        }
        var o = {};
        // for(var k in  obj)
        // {
        //     // k 是属性名 obj[k]是属性值
        //     o[k] = obj[k];
        // }
        // console.log(o);
        // o.msg.age= 30;
        // o.msg.name= '656';
        // console.log(obj);
        console.log('----------');
        Object.assign(o,obj);
        console.log(o);
        o.msg.age = 200;
        o.name = '532';
        console.log(obj);
    </script>
</body>
</html>

24.深拷贝
浅拷贝只是拷贝一层,更深层次对象级别的值拷贝引用
深拷贝拷贝多层,每一级别的数据都会拷贝。
Object.assign(target, …sources) ES6新增方法可以浅拷贝
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>24.深拷贝</title>
</head>
<body>
    <script>
      var obj = {
            id:1,
            name:'angle',
            msg:{
                age:18
            }
        }
        var o = {};
        function deepCopy(newobj,oldobj)
        {
            for(var k in oldobj)
            {
                //判断我们的属性值属于哪种数据类型
                //1.获取属性值 oldobj[k]
                var item = oldobj[k];
                //2.判断这个值是否是数组
                if(item instanceof Array){
                    newobj[k]=[];
                    deepCopy(newobj[k],item);
                }
                //3.判断这个值是否是对象
                else if(item instanceof Object){
                    newobj[k]={};
                    deepCopy(newobj[k],item);
                }
                //4.属于简单数据类型
                else{newobj[k]=item;}
            }
        }
        deepCopy(o,obj);
        console.log(o);
 
        var arr =[];
        console.log(arr instanceof Object);
        o.msg.age =201;
        o.name ='aaa';
        console.log(obj);
    </script>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020

# 四、正则表达式

为什么使用 ES6?

每一次标准的诞生都意味着语言的完善,功能的加强。JavaScript语言本身也有一些令人不满意的地方。
    变量提升特性增加了程序运行时的不可预测性
    语法过于松散,实现相同的功能,不同的人可能会写出不同的代码
1.let关键字
ES6中新增的用于声明变量的关键字。

1.let 声明的变量只在所处于的块级有效
 

if (true) {
	let a = 10;
}
console.log(a); // a is not defined  
 注意:使用let 关键字声明的变量才具有块级作用域,使用var声明的变量不具备块级作用域特性

 2.不存在变量提升

console.log(a);  // a is not defined
let a = 20;   
3.暂时性死区

  var num = 10;
        if(true)
        {
            console.log(num);
            let num = 203;
        }
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>1.let关键字</title>
</head>
<body>
    <script type="text/javascript">
        //let关键字就是用来声明变量的
        //1.使用let关键字声明的变量具有块级作用域
        //在一个大括号中 使用let关键字声明的变量才具有块级作用域 var关键字是不具备这个特点的
        //2.防止循环变量变成全局变量
        //3.使用let关键字声明的变量没有变量提升
        //4.使用let关键字声明的变量具有暂时性死区特性
 
        // let a = 10;
        // console.log(a);
 
        // if(true)
        // {
        //     let b = 20;
        //     console.log(b);
        //     if(true)
        //     {
        //         let c = 30;
        //     }
        //     console.log(c);
        // }
        // console.log(b);
 
         //在一个大括号中 使用let关键字声明的变量才具有块级作用域 var关键字是不具备这个特点的
        // if(true)
        // {
        //     var abc = 'abc';
        //     let num = 'num';
        // }
        // console.log(abc);
        // console.log(num);
 
        // 防止循环变量变成全局变量
        // for(let i =0;i<2;i++)
        // {
 
        // }
        // console.log(i);
 
        //不存在变量提升
        //使用let关键字声明的变量没有变量提升
        // console.log(a);
        // let a = 20;
 
        //使用let关键字声明的变量具有暂时性死区特性
        var num = 10;
        if(true)
        {
            console.log(num);
            let num = 203;
        }
    </script>
</body>
</html>

2.经典面试题
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>2.经典面试题</title>
</head>
<body>
    <script>
    //var
    var arr = [];
    for(var i =0;i<2;i++)
    {
        arr[i] = function(){
            console.log(i);
        }
    }
    arr[0]();
    arr[1]();
 
    //let
    for(let i =0;i<2;i++)
    {
        arr[i] = function(){
            console.log(i);
        }
    }
    arr[0]();
    arr[1]();
    </script>
</body>
</html>
3.const关键字
作用:声明常量,常量就是值(内存地址) 不能变化的量

1.具有块级作用域

if (true) {
	const a = 10;
}
console.log(a); // a is not defined
2.声明常量时必须赋值

const PI; // Missing initializer in const declaration

3.常量赋值后,值不能修改

//常量声明后值不可更改
const PI = 3.14;
PI = 100; // assignment to constant variable.   
 
const ary = [100, 200];
ary[0] = 'a';
ary[1] = 'b';
console.log(ary); // ['a', 'b'];
ary = ['a','b']; // assignment to constant variable.   
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>3.const关键字</title>
</head>
<body>
    <script type="text/javascript">
        //使用const关键字声明的变量具有块级作用域
        // if(true)
        // {
        //     const a =10;
        //     if(true)
        //     {
        //         const a = 20;
        //         console.log(a);
        //     }
        //     console.log(a);
        // }
        // console.log(a);
        
        //使用const关键字声明的变量必须赋初始值
        // const PI = 3.14;
 
        //常量声明后值不可更改
        const PI = 3.14;
        PI = 100; // assignment to constant variable.   
 
        const ary = [100, 200];
        ary[0] = 'a';
        ary[1] = 'b';
        console.log(ary); // ['a', 'b'];
        ary = ['a','b']; // assignment to constant variable.   
    </script>
</body>
</html>
4.let、const、var关键字的区别
使用var声明的变量,其作用域为该语句所在的函数内,且存在变量提升现象。
使用let声明的变量,其作用域为该语句所在的代码块内,不存在变量提升。
使用 const 声明的常量,在后面出现的代码中不能修改该常量的值。

 5.数据解构
ES6 中允许从数值中提取值,按照对应位置,对变量赋值。对象也可以实现解构。

 let [a, b, c] = [1, 2, 3];
console.log(a);
console.log(b);
console.log(c);    
// 如果解构不成功,变量的值为undefined 
let [foo] = []; //undefined 
let [bar, foo] = [1];   //undefined 
let ary = [1,2,3];
let[a,b,c,d,e] = ary;
console.log(d);//undefined 
console.log(e);//undefined 

6.对象解构
//对象解构允许我们使用变量的名字匹配对象的属性 匹配成功将对象属性的值赋值给变量
let person = { name: 'zhangsan', age: 20 }; 
let { name, age } = person;
console.log(name); // 'zhangsan'
console.log(age); // 20    
          
let {name: myName, age: myAge} = person; // myName myAge 属性别名
console.log(myName); // 'zhangsan' 
console.log(myAge); // 20 

7.箭头函数
ES6中新增的定义函数的方法。

() => {}    
const fn = () => {}
 函数体中只有一句代码,且代码的执行结果就是返回值,可以省略大括号

function sum(num1, num2) {
    return num1 + num2;
}    
const sum = (n1,n2)=>{return n1+n2;}
const sum = (num1, num2) => num1 + num2;//省略大括号
如果形参只有一个,可以省略小括号

function fn(v){
    retuen v;
} 
const fn = v => v;

7.箭头函数中的this关键字
箭头函数不绑定this关键字,箭头函数中的this,指向的是函数定义位置的上下文this。

function fn(){
    console.log(this);
    return ()=>{
        console.log(this);
    }
}
const obj = {name:'wangwu'};
const resFn = fn.call(obj);
resFn();

8.箭头函数面试题
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>7.箭头函数面试题</title>
</head>
<body>
    <script type="text/javascript">
    var age = 200;
    var obj={
        age:20,
        say:()=>{
            console.log(this.age);
        }
    }
    obj.say();
    </script>
</body>
</html>

9.剩余参数
剩余参数语法允许我们将一个不定数量的参数表示为一个数组。

function sum (first, ...args) {
    console.log(first); // 10 
    console.log(args); // [20, 30]
}
sun(10, 20, 30);
    const sum =(...args)=>{
        let total = 0;
        // args.forEach((item)=>{
        //     total += item;
        // })
        //简写为
        args.forEach(item=> total += item )
        return total;
    }
   console.log(sum(10,20));
   console.log(sum(10,20,30));
10.剩余参数和解构配合使用
    let ary1 = ['张三','李四','王五'];
    // let [s1,...s2] = ary1;
    let [s1,...s2] = ary1;
    console.log(s1);// 张三
    console.log(s2);// ['李四', '王五']
11.扩展运算符
扩展运算符可以将数组或者对象转为用逗号分隔的参数序列。

let aty = [1, 2, 3];
// ...ary  // 1, 2, 3
console.log(...ary);  // 1 2 3 
console.log(1, 2, 3); // 1 2 3
console.log(ary); //[1, 2, 3]
 
12.扩展运算符应用:合并数组
扩展运算符可以应用于合并数组。

//方法一 
let ary1 = [1, 2, 3];
let ary2 = [3, 4, 5];
let ary3 = [...ary1, ...ary2];
//...ary1 //1,2,3
//...ary2 //4,5,6  
console.log(ary3);
// 方法二
var ary1 = [1,2,3];
var ary2 = [4,5,6];
ary1.push(...ary2);
console.log(ary1);
13.扩展运算符应用:将伪数组转换为真正的数组
var oDivs = document.getElementsByTagName('div');
console.log(oDivs);
var ary = [...oDivs];
ary.push('a');
console.log(ary);

14.Array扩展方法:Array.from方法
将类(伪)数组或可遍历对象转换为正真的数组

var arrylike = {
    "0":"张三",
    "1":"李四",
    "2":"王五",
    "length":3
}
console.log(arrylike);//{0: '张三', 1: '李四', 2: '王五', length: 3}
var ary = Array.from(arrylike);
console.log(ary);//['张三', '李四', '王五']
方法还可以接受第二个参数,作用类似于数组的map方法,用来对每个元素进行处理,将处理后的值放入返回的数组。

var arraylike = {
    "0":"1",
    "1":"2",
    "length":2
}
var ary = Array.from(arraylike,item=>item*2) // 2 4
console.log(ary);
15.Array实例方法:find
用于找出第一符合条件的数组成员,如果没有找到返回undefined

let ary = [{
    id: 1,
    name: '张三' 
},{
    id: 2,
    name: '李四'
}];
let target = ary.find((item, index) => item.id == 2);
console.log(target);//{id: 2, name: '张三'}

16.Array实例方法:findIndex
用于找出第一个符合条件的数组成员的位置,如果没有找到返回-1

let  ary = [10,20,50];
let index = ary.findIndex(item => item> 15);
console.log(index);//1

17.Array实例方法:includes
表示某个数组是否包含给定的值,返回布尔值

let ary = ["a","b","c"];
let result = ary.includes('a');
console.log(result);//true
result = ary.includes('e');
console.log(result);//false
18.模板字符串
ES6 新增的创建字符串的方式,使用反引号定义。

let name = `zhangsan`;
 特点1. 模板字符串中可以解析变量。

let name = '张三';
let sayHello = `hello,my name is ${name}`; // hello,my name is zhangsan 
 特点2. 模板字符串中可以换行

let resilt = {
    name: 'zhangsan',
    age: 20,
    sex:'男'
}
let html = ` <div>
    <span>${result.name}</span>
    <span>${result.name}</span>
    <span>${result.name}</span>
</div> `;
特点3. 在模板字符串可以调用函数。

colst aryHello = function () {
    return '哈哈哈哈 追不到我吧 我就是这么强大';
};
let greet = `${sayHello()} 哈哈哈哈`;
console.log(greet); // 哈哈哈哈 追不到我吧 我就是这么强大 哈哈哈哈 

19.startsWith方法和endsWith方法
实例方法:startsWith() 和 endsWith()

startsWith(): 表示参数字符串是否在原字符串的头部,返回布尔值
endsWith(): 表示参数字符串是否在原字符串的尾巴,返回布尔值
let str = 'Hello ECMAScript 2015';
let r1 = str.startsWith('Hello');//true
console.log(r1);
let r2 = str.endsWith('2016');//true
console.log(r2);
20.repeat方法介绍
repeat 方法表示将原字符串重复n次,返回一个新字符串。

console.log('y'.repeat(5));//yyyyy

21.创建set数据结构并利用set数据结构做数组去重
ES6 提供了新的数据结构 Set 它类似于数组 但是成员的值都是唯一的 没有重复的值
Set本身是一个构造函数,用来生成 Set 数据结构。

const s = new Set;

Set函数可以接受一个数组作为参数,用来初始化。

const set = new Set([1, 2 ,3 ,4 , 5]);

    实例方法:
        add(value): 添加某个值,返回Set结构本身
        delete(value): 删除某个值,返回一个布尔值,表示删除是否成功
        has(value): 返回一个布尔值,表示该值是否为Set的成员
        clear(): 清除所有成员,没有返回值

const s1 = new Set();
console.log(s1.size);// 0
const s2 = new Set(["a","b"]);
console.log(s2.size);// 2
const s3 = new Set(["a","a","b","b"]);
console.log(s3.size);// 2
const ary = [...s3];
console.log(ary);//['a', 'b']

22.set对象实例方法
const s = new Set();
s.add(1).add(2).add(3);     // 向 set 结构中添加值
s.delete(2)                 // 删除 set 结构中的2值
s.has(1)                    // 表示 set 结构中是否有1这个值 返回布尔值 
s.clear()                   // 清除 set 结构中的所有值                     
const s4 = new Set();
//向set结构中添加值 使用add方法
s4.add('a').add('b');
console.log(s4.size);//2
//从set结构中删除值,用到的方法是delete
const r1 = s4.delete('a');
console.log(s4.size);//1
console.log(r1);//true
//判断某一个值是否是set数据中的成员 使用has
const r2 = s4.has('b');
console.log(r2);//true
//清空set数据结构中的值 使用clear方法
s4.clear();
console.log(s4.size);//0

 23.遍历set
Set 结构的实例与数组一样,也拥有forEach方法,用于对每个成员执行某种操作,没有返回值

const s5 = new Set (['a','b','c','d','e']);
s5.forEach((value)=>{
    console.log(value);
})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471

转载自 (opens new window)

Last Updated: 5/15/2022, 5:17:53 PM
강남역 4번 출구
Plastic / Fallin` Dild