前端学习(442):回调函数

倾然丶 夕夏残阳落幕 提交于 2020-01-19 16:56:33
<!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>函数参数</title>
</head>
<body>
    <script>
    function fn5(o,fn){
        o.a+=1;
        fn(o);
    }
    function fn6(_o){
        _o.a+=10;
    }
    function fn7(_o){
        _o.b=20;
    }
    var obj4={a:1};
    fn5(obj4,fn7);
    console.log(obj4);
    </script>
</body>
</html>

运行结果

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!