箭头函数

2018-04-03  本文已影响0人  Clayten
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
        let fn = v => v;//第一个v参数,第二个v是返回值
        let fn1 = () => "hi";
        let fn2 = v => {
            console.log(v+".....");
            console.log(v+".....");
            console.log(v+".....");
        }
        fn2(12)
        let fn3 = (x =20, y = 10) =>{
            console.log(x+y);
        }
        fn3(20,20);
    </script>
</body>
</html>
上一篇 下一篇

猜你喜欢

热点阅读